Autocomplete for a city/location in the search bar using google places API

Hi,

I attended an office hours and know that we use the Search with Results component and then modify the workflow, but I need the proper javascript or API to call to get the location/places results.

Any help if awesome!

Thanks,
Dave

Hey,

First, you’ll need to add the “search with results” element to your page:
CleanShot 2023-09-28 at 17.46.12

Then, you’ll need to update the “on change” workflow for when something gets typed in the input to hit the API you want to use with the REST API plugin:
CleanShot 2023-09-28 at 17.45.08

Then, you’ll need to update the collection list containing all the results by binding it to the API’s results:
CleanShot 2023-09-28 at 17.45.31
CleanShot 2023-09-28 at 17.44.44

How to query the API and how the results will be displayed depend on which API you’re gonna use (all APIs are different, you’ll need to check their documentation).

Do you have any idea of which service you wanna use?

1 Like

Thank you, Quentin! I’m looking to maybe use Google Places API but I’m interested in other alternatives. Do you know of some that other customers of yours use?