Hi everyone,
I’ve been working on integrating the Uber Direct API into my Bubble marketplace app, and I’m facing several challenges related to timing, JSON formatting, and workflow sequencing especially when trying to dynamically generate and pass formatted JSON addresses for delivery quotes.
Goal:
I need to create a delivery quote by calling Uber’s API with properly formatted pickup_address
and dropoff_address
JSON strings (as required by Uber’s specs). These addresses must be constructed dynamically using data from the current cart’s seller and buyer.
What I’ve done so far:
-I created two backend workflows (generate_pickup_address_json
and generate_dropoff_address_json
) that return JSON strings using Return data from API
.
-On the frontend, I created three custom events:
-Generate Pickup Address
Generate Dropoff Address
Continue Uber Quote
(which calls the Uber API using the previously generated JSON).
-The main workflow triggers all three in sequence.- Each custom event uses
Schedule API Workflow
and then attempts toset a custom state
to the result of the backend workflow.
Problems I’ve encountered:
- Timing issues: Even though I’ve structured the workflow with custom events to ensure sequence, the pickup and dropoff JSON sometimes aren’t ready by the time the Uber API call is made , likely because
Schedule API Workflow
is asynchronous. - Data not showing up: I’m using a group like
Group Pickup JSON Helper
and a text element inside it (Text Pickup JSON
) to construct the JSON string visually. But in the custom event’sReturn data from API
action, I cannot referenceText Pickup JSON's text
. OnlyGroup Pickup JSON Helper's text
appears, which doesn’t yield the value I expect. - Bubble limitations: Bubble doesn’t allow mixing static and dynamic content directly in custom state values, and I can’t
set state
toResult of step X
if that step is a custom event. This has made chaining logic really difficult. - Lack of JSON preview/debugging: Even when I try to verify JSON strings in preview using text elements, they come up empty — possibly due to timing or because I can’t access the nested text element properly.
What I’ve tried:
- Using text elements inside groups to build and preview JSON.
- Returning data from backend and custom events.
- Using custom events to control timing instead of sequential steps in a single workflow.
- Making sure content-type in API responses is
plain text
. - Manually escaping JSON strings.
- Using Bubble logs and inspector to trace workflow order and data.
What I need help with:
How can I reliably construct and pass JSON strings from dynamic address data for Uber Direct API in Bubble?
How can I return the contents of a specific text element (not the group) from a custom event?
Any best practices for chaining asynchronous backend workflows with frontend states and API calls?
I feel like I’m hitting a wall with Bubble’s limitations around dynamic text and workflow timing. If anyone has solved something similar or has a cleaner approach, I’d be super grateful for tips or examples.
Thanks!