Help

Re: Create a button to link address in google maps

3288 0
cancel
Showing results for 
Search instead for 
Did you mean: 
BrianONeill
4 - Data Explorer
4 - Data Explorer

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.

7 Replies 7

You have to URL encode your address and city using the ENCODE_URL_COMPONENT() function. Otherwise, you’re not creating a valid URL.

TheTimeSavingCo
18 - Pluto
18 - Pluto

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?

Screenshot 2024-03-02 at 7.54.14 PM.png
Link to base

I think you may need to seperate the "Address" and "City" values with a space too

BrianONeill
4 - Data Explorer
4 - Data Explorer

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

 

ScottWorld
18 - Pluto
18 - Pluto

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. 

Thank you Scott. I copy pasted your code but still no luck.

To clarify I am editing the button in the interface editor, see my screenshot. 

Is this the right way to do it? The input button for the URL seems to be just a single line.

ScottWorld
18 - Pluto
18 - Pluto

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.

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:

Screenshot 2024-03-05 at 5.56.28 PM.png

Then use the "Go to URL in record" option and select the formula field:

Screenshot 2024-03-05 at 5.54.57 PM.png

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!