Each User has a list of Things. When the user clicks a button, it should delete the first item from the list, and then display the first item from that list (which would be the second item from the list before the workflow ran). Here is the workflow:
Deleting the first item:
Displaying the new first item:
What instead happens is that it displays the first item from the list, and then deletes the first item from the list.
How can I make sure that the deletion action happens first and then the display action happens?
As actions in workflow are asynchronous (they can be executed at the same time), the best method to be assured not running âout of orderâ is simply used a condition Only when in Display data saying âif action 1 isnât emptyâ.
The âmake changesâ step is happening on the server, and the display data step is happening on the client.
There is some internal logic that checks if the client code needs to wait for the server code to finish, unfortunately this is one of the situations where it doesnât notice the dependency.
You can work around it by setting the value âcurrent userâs display product list # item 2â to either a custom state or a group, before running the make changes step.
Or you can see if the dependency can be put in, by modifying a simple field like a number, and writing that number to a client element afterwards.
Can you elaborate @mishav on that matter as I expect dependency to work on any cases. (surprised to see otherwise). So to resolved that particular action out of order it will be âfakingâ value in a state first and then referred to it? This case can be sent to Bubble for investigation or it is simply the js logic fault?
I agree with you @JohnMark.
Im also interested in @mishavâs explanation to why this didnât work.
When I saw your answer I thought it should have worked.
I gave it a try, and if the âmake changesâ step alters a text field in the database thing, the updated field is used by the âdisplay dataâ step. But, if it changes a list field as well, the prior value of the listâs first item is still used on the second step.
So, looks like the dependency is not just on the workflow steps, but also in the particular dynamic expression, and a list field doesnât do it correctly.
@joshua.hovden I suggest you raise it as a bug, and link in this discussion.
EDIT - this post by @josh explains at high level what I mean by âdependency between stepsâ âŚ