(Solved) Dynamic Inputs for using Maps Distance Matrix API to calculate distances

Hey Guys!

I am new to bubble and amazed by all the possibilities it offers. That’s great stuff so far! Thanks to the smart people behind this.

Currently, I am building an MVP for a price calculator. The first step is to calculate distances between a warehouse and multiple addresses. I’ve stored all addresses’ longitude and latitude data and use this data as the origin address. The destination address (warehouse) is typed in as a geographical address.

Problem: Using the built-in distance calculator takes too long (roughly 30 distance calculations) to calculate all distances which is why I tried to set up the Google Maps Distance Matrix API. I got the API call to work in Postman, however, if I try to set the API up in bubble and use dynamic values (the addresses’ longitude and latitude data) I fail.

Can someone tell me what I need to do?

That’s what the Call looks like - I want to trigger the distance calculation via a button and search for all addresses longitude/latitude data.

However, calculating the distance for our handling terminal in Atlanta (ATL) does not work as I can’t specify the dynamic inputs correctly:

Appreciate any input! Thanks a lot.

Best,
Julian

Just solved it myself - figured out that I need to check “client-safe”…

Best,
Julian

1 Like

Good job. I might need this in the future. Could you pls add [SOLVED] to your heading and it’s easier for me to see that there’s a working solution to your post.

Cheers

Hi @julian.treidler could you please share the solution you applied? It would be really helpful as I am trying to do something similar.

Help is appreciated.

-Komal

1 Like