Mar 01, 2024 09:39 AM
I am trying to add a button in the interface designer to open up the address in google maps. I want to pass the address and city field to google maps
So something like:
"https//google.com/map/place/" & {Address} & {City}
I can't seem to get it to work. Existing examples on this forum seem to refer to the old interface designer.
On the new version can you do this? If so can anyone suggest the correct format?
Thanks in advance.
Mar 01, 2024 10:00 AM
You have to URL encode your address and city using the ENCODE_URL_COMPONENT() function. Otherwise, you’re not creating a valid URL.
Mar 02, 2024 03:55 AM - edited Mar 02, 2024 03:56 AM
Hmm, so each record has their own unique "Address" and "City" value and you're selecting the record in some way in the Interface, is that right? If that's the case, does this look about right?
Link to base
I think you may need to seperate the "Address" and "City" values with a space too
Mar 04, 2024 03:44 AM
Thanks for the responses.
Remember I am trying to add a button to do this in the interface editor, not the sheet view. Or do I need to do it in sheet view to then be able to embed it?
I tried:
'https//google.com/map/place/' & 'prefill_' &ENCODE_URL_COMPONENT('Address') & '=' &ENCODE_URL_COMPONENT({City})
But in interface view it does not work.
If you are giving examples would you mind share the code/formula as I am finding this very complex.
Thanks
Mar 04, 2024 05:25 AM - edited Mar 04, 2024 05:30 AM
Yes, you can use either a button field or a button element on an interface. You can also display a formula field as well.
Remember that you will need to create the URL in the way that Google Maps is expecting it.
Here’s one way of doing it:
"https://www.google.com/maps/place/"
&
ENCODE_URL_COMPONENT({Address})
& "," &
ENCODE_URL_COMPONENT({City})
BTW, if you want even deeper integration & more advanced automations with Google Maps — or if you want to create the Google Maps links without writing any formulas at all — you can always turn to Make’s Google Maps integrations.
p.s. I am also available for hire as an expert Airtable consultant to help with advanced workflows like this.
Mar 04, 2024 06:29 AM
Mar 04, 2024 06:56 AM - edited Mar 04, 2024 06:57 AM
Oh sorry, that's a 3rd type of interface button that doesn't let you specify URLs based on a formula.
You would either need to add a button field to your interface, or start with one of the more flexible interface pages that let you add custom button elements to your interface. Those more flexible interface pages are the "blank" interface, the "record review" interface, and the "record summary" interface.
Mar 05, 2024 01:58 AM - edited Mar 05, 2024 02:01 AM
Hmm, the screenshot in my previous message is a Record Review page and not a sidesheet view actually, so I think it does what you need?
To replicate it, you'll need to create a formula field to paste the formula in, resulting in this:
Then use the "Go to URL in record" option and select the formula field:
You can also duplicate the base into your own workspace, giving you access to all the formulas and how the interface is set up so that you can experiment with it!