Hello Bubble community.
I’m working on an application that uses the Google Distance Matrix API to calculate the distance between two addresses entered by the user via Search Boxes (sb.depart and sb.arrive).
Problem encountered:**
- The API works fine when I put static values in the API Connector (e.g.
Dakar, Senegal
andMbour, Senegal
). - But as soon as I try to pass dynamic values from the Search Box (
sb.depart's value
andsb.arrive's value
), the API continues to take the static values into account, and does not update the distance dynamically.
Current configuration:**
In the API Connector, I’ve defined the URL Parameters as follows:
- Key:
origin
→ Value:[origin]
- Key:
destination
→ Value:[destination]
In Workflow :
- When the user clicks on “Confirm addresses ”, I update a Custom State with
sb.depart's value
andsb.arrive's value
. - I call the Distance Matrix API, replacing
[origin]
by the Custom Stateorigine_temp
and[destination]
bydestination_temp
.
What I’ve tested:**
Test API with static values in API Connector → OK
Check that Search Box values are stored in App Data → OK
Check that API receives dynamic values → NO (always static values)
Questions for the community:
What’s the right way to pass dynamic values (Search Box) to the Distance Matrix API?
Do I need to change the configuration in the API Connector, or is this a workflow issue?
Do I need to add another step to force Bubble to update the values?
Thanks in advance for your help!