Forum Academy Marketplace Showcase Pricing Features

Error Sending Javascript Bubble's Data to API Workflow

Hi all,

Has anyone tried to send a Javascript Bubble’s Data to an API Workflow ? It seems that I can’t receive my value server-side. Bubble support can’t help me with this issue so I’m relying on the community :slight_smile:

Thanks for your help !

I made a very simple example below:

Step 1: When Button is clicked, I send data from Javascript to Bubble using “bubble_fn”.

Step 2: I send this data to an API Workflow using JavascriptBubble (this value exists because I console log in Step 2)

Step 3 : I just return the value received from client side to check if I receive it

Step 4 : Value passed from client to API Workflow is empty here. I did not receive it. I can see it in the server logs.

For those looking for an answer, you should separate actions from “client side” with actions from “server side” by using “Schedule a custom event” and create a custom event to trigger your API Workflow. You can use data saved in your state to send to your API Workflow.

Don’t use “Trigger Custom Event”. “Schedule a Custom Event” will execute the custom event in a separate workflow, whereas “Trigger Custom Event” will execute immediately in the same workflow.

I hope it helps people in the community :slight_smile:

Hi @minh.iae

Actually the best solution for your specific use case is not to schedule a custom event because it only relies on an arbitrary duration.

In fact the javascript to Bubble element provides an event triggering when the function is called (you need to check the box on the element). You should use this to make sure that your data is ready to be sent to the backend.

Look for the event “A Javascript element Event”



Hi @arthur.kieffer

Thanks for bumping in. I will give your solution a try, it does look like a safe solution to send data only when it’s ready !

Thanks for sharing :slight_smile: