Workflow does not run with arranged steps

Hello, I am creating a marketplace project so I have cart items table and page. Also purchases table.
After finishing checkout by stripe, I must send all items stored in the cart table to the purchases table.
So I created actions(step 1 and step 2 ) to stripe
The action(step 3 ) for adding a list of items stored in a cart is to purchase a table.
The action(step 4 and step 5 ) for sending emails after the stripe finish.
The action(step 6 ) is to remove all items that already exist in the cart item table after the past actions are finished.

My problem is:
the action(step 6) is working before action(step 3) is done. So items already purchased from the user does not store in the purchase table because the action(step 6) removes all records before finishing from action( step 3).
In the end, when removing the action (step 6) delete the action, and everything is good with the action( step 3). but then add the last action (step 6) I have a problem.
NOTE: I need the action(step 6) to remove all items stored in the cart item table after the purchase is finished.

Action(step 3)

Action(step 6)

You don’t really mean to delete the Cart Items, do you? Attaching the Cart Items to the order doesn’t move them, it simply attaches a reference to the specific Cart Items to the “Purchase” item.

If you delete the Cart Item things, the list of Cart Items on the Purchase thing will disappear because they no longer exist in the database.

The list of Cart Items on the Purchase is just a list of references to the specific instances of the Cart Item datatype. They don’t get “copied” and now “live with” the Purchase.

You might want to go watch the first Bubble crash course video to understand the database (which is best thought of as storing objects of various types, and not being a collection of various “tables”).

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