Help with Google Search Places API

hi all, could use some help here. I have the below code. i have a winning piece of text, that is randomly generated everytime a button is clicked and then i want it inserted into the query part each time ( instead of the word sport). i’m using the google search API in my project.

function initMap() {                                                         
  var map = new google.maps.Map(
      document.getElementById('map'), {zoom: 15, center: {lat: 53.508709, lng: -6.460100},});
  var request = {                                                           
    location: {lat: 53.508709, lng: -6.460100},                             
    radius: '10',                                                           
    query: 'sport',                                                       

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.