Input X,Y for API parameter

I have custom locations names with unique latitudes and longitudes stored in my Bubble database.

These unique lats and longs don’t correspond to addresses so converting them to an address wouldn’t work in this situation.

I need to pass the longitude,latitude to my Google Maps Directions API parameter like so: “48.86,2.29”.

I can pass either latitude or longitude, but I don’t know how to pass both of them together separated by a comma.

Similarly, I would like to pass a variable number of “waypoints” (stops between starting and ending destination) to the waypoints parameter like so: “48.86,2.29|49.26,3.39”.

Again I’m not clear on how to pass variables to a parameter separated by a character of my choosing.

Thanks in advance!

Have you tried using the “:formatted as” operator for boolean values?

1 Like

Hi @vini_brito thanks for the response. I’ve toyed with that feature but I still don’t see how to get a comma between the longitude and latitude (even with that feature).

Share what you tried, including the attempt “:formatted as”

@vini_brito you can see my attempt at using “:formatted as” in my highlight in this screenshot:

The only potentially relevant option I could see under formatted as was maybe format as number which I did in the highlight.

But the number it generates, 1028.58, doesn’t correspond to any number in my database.

Furthermore, I don’t see any option to add a comma and then input a second value, the latitude.

I appreciate your help!

Good! Take a look at this answer, the “:formatted as” is a bit different. It starts with a boolean value and you build the text however you want.
You can scan the forum for more threads mentioning it if needed.

Those are interesting solutions mentioned in that thread.

But I didn’t see how any of them related to my problem, exactly.

Most of the comments in that thread talk about using booleans.

However, I don’t have a boolean value option to select.

Did you get this working? Thanks!

No, I gave up.

okkay so just a quick overview, i’ll be honest in that i’m not quite following your problem, however this what i do for coordinates:
image
(it isn’t actually outputting 1028.58, that’s just an example), and “Location” is a text data type - but this get’s both sides into a single field in my database…

that being said, for optimized directions, i’ve had good luck up until recently using this plugin:

Thanks for sharing!