muzz
1
I am using the Toolbox plugin to run JavaScript and store the returned JSON as text inside the database.
Here is the flow:
- Button clicks.
- Run JavaScript and store the response in a state.
- Pass the state to a backend workflow.
- Backend workflow updates the database.
Steps 2 and 3 are executed in their own Custom Events to ensure they are synchronous.
The issue is that the value stored in the database is empty on the first try. However, when I retry, the value is successfully stored.
Could it be that Run JavaScript takes more time to execute, causing the backend workflow to trigger before it’s completed?
The better way is
- Button click > Run Javascript (your script must pass your result to a JavaToBubble Element
bubble_fn_J2BnameHere(value))
- Use the “JavaToBubble Event” trigger to pass it’s value to your backend WF.
Make sure to check the appropriate boxes in the JToB element.
1 Like
muzz
3
Thanks.
Yeah, I actually had to use the Javascript Event to capture the output from javascript and then perform next actions.
1 Like