Forum Academy Marketplace Showcase Pricing Features

Stuck :( Please Help - Unable to extract specific address components from Google Place Details

Hi everyone,

I am using the Google Places plugin from Bubble combined with a custom Google Place Details API call to pre-populate form fields based on a Google Places autocompleted search.

Surprisingly, I have it about 90% working and the Place Details API request seems to coming back correctly.

The problem I am having is that all of the address components are coming back as a comma delimited array and I finding it difficult to target (extract) specific address components so that I can populate separate form fields with each individual address component. I want things like city, province and country to all be in separate fields and not combined as one long address string.

Of course I could try to extract based on item # but not addresses have the same address components and they are not always in the same order. The most reliable way would be if I could target these components by name. For example locality, political or administrative_area_level1, political or country.political.

If you’re wondering why I did not just uses the built-in geographic places search and then just extract the address from that, it is because I need to look up additional information about the place and I did not find the Place IDs to be reliable. I think the Place IDs that the built-in geographic places functionality uses are for a specific addresses and not a specific establishments — and many establishments could exist at the same physical address.

Anyways, and ideas or feedback on how I am target specific address components (knowing they are not always the same or the same order) to fill out my form fields, it would be GREATLY appreciated.

Many thanks,

Use “:extract” operator

Thank you @shpak.serhiy. The :extract operator did exactly what I needed. I had tried that previously, but I was applying it to wrong element. Once I applied that operator to the RG’s selected item, it worked a charm! Thanks for taking the time to reply to my question :slight_smile: