Custom State has the value in pervious step but dont submit value in the next step

Hi my custom state has the value in the previous step but doesn’t submit value in the next step, put it empty in the database, In fact it the previous step while debugging you can see the value, Here is the app preview : Wordform | Bubble Editor

Hi @earthkoed :wave:

This may be happening because Bubble may be running your workflow asynchronous.

If you run the debugger STEP-BY-STEP the workflow works like it should?

2 Likes

Schedule API workflow actions do not follow the workflow sequence. It’s in the manual.

A quick solution is to put it into a custom workflow.

2 Likes

Yes dashboard's fields2-as-string show its value on Step 3 but on the Step 4 it submit as empty

but its taking value of dashboard's field_as_string but doesn’t taking the 2nd value dashboard's fields2-as-string

Even running your workflow step by step using the debugger, the issue persists??
Then the problem is not with your workflow being played asynchronous.

Can you share a video of you running this script step by step with the debugger?

1 Like

I agree with @ihsanzainal84

Place the schedule API WF in a custom event. You can still get the values in the custom state since you can access its values anywhere in the page. The values are also not reliant to any previous actions in the workflow.

This way, you can make sure that the previous actions (setting the state values) are finished before you schedule the API workflow.

Doesn’t the schedule an API WF action run asynchronously regardless if you run the workflow step by step in the debugger? If I remember correctly, only the frontend actions mainly follow the step by step action in the debugger…

Tried this workflow step by step and the deleting things action was still fired off even if I haven’t proceeded to the next step yet

  1. set state x to yes
  2. set state x to no
  3. set state x to yes
  4. add a pause before the next action
  5. delete a list of things
2 Likes

Thanks @rpetribu here is the step by step loom using the debugger : Loom | Free Screen & Video Recording Software | Loom

Yes, running the WF step by step will respect the order. :+1:

@earthkoed

Let’s test something…

Instead of pull the data from your Dashboard’s custom state “fields2-as-string”, try to write it dynamically, the same way you used to store the data inside it.

Change this:

To: dashboard's fields2:Join with ,

1 Like

@rpetribu Just tried but same empty results :frowning:

While debuggin, please click here:

See the value stored in this custom state.

1 Like

This.

It’s a timing issue. Scheduling API workflows can and will more than often trigger first regardless of where you put the action in a workflow.

Put the Schedule API workflow into a custom workflow and run that custom workflow instead (after setting your state). You are using states so you can retrieve your values anywhere.

There are a few ways to ensure that actions run synchronously (finally got my terminology correct) in Bubble: Custom workflows, reffering to a previous step’s value (eg. a previously created thing’s value) or the “Do When” workflow.

Native front end actions such as setting states will run synchronously (unless the data being loaded is extremely large) so you can use states as a method of control.

Optimizing my CRM for WU requires a lot of synchronization and i follow those steps i shared. That and Floppy. Lots and lots of Floppy expression watchers.

2 Likes

It’s a helpful tool for sure, @ihsanzainal84! (Floppy Expression Watcher)

1 Like

Thanks every one for the help, it seems working now with same workflows keeping everything same lol.

But I was alway running it by debug to check whether it’s submitting fields2 or not.

During step by step debug it doesn’t but during simple run it does.

This topic was automatically closed after 70 days. New replies are no longer allowed.