Submit Order workflow not deleting rows from related Cart group

Hi everyone!

I’m building a takeaway app in Glide, and I need some help with the workflow for my Submit Order form.

Here’s what I’m trying to do:

  • When a user places an order, I want to:
  1. Add a row in the `Customer Orders` table
  2. Set a default status (“Received”)
  3. Delete all rows from the `Cart` table related to the user’s `Cart Group ID`
  4. Show a confirmation notification
    It adds the new row and sets the status correctly, but the **Delete Rows** action doesn’t work when I use the **Relation to Cart Group**. However, if I use **Relation to User**, it works – but that deletes all cart items linked to the user, regardless of witch Cart Group they belong to.

I’m using a relation column from `Customer Orders` to `Cart`, based on a unique template of `Cart Group ID + Email`.

Any idea what I might be doing wrong? Should I be using a different relation format or workaround?

Thank you so much in advance!

What is a Cart Group in your context? Can a user hold multiple cart groups at the same time?

How do you keep the context of what an order contains after an order is submitted, if you delete all the cart rows table?

I would suggest adding a comma-delimited list of cart row IDs to the orders table, so you don’t have to do some other workarounds.

Hi ThinhDinh,

Thank you for your reply!

To clarify: users can only have one active cart group at a time, and I’m using a unique Cart Group ID + Email to link orders to cart items. I did try using a Relation to User, and while it works, it ends up deleting all cart items from that user, even from past or future cart groups — which I want to avoid.

For now, I think I’ll continue using lookups to copy item names and totals into the Customer Orders table before deleting the cart, but your idea with comma-delimited Row IDs is super helpful and I’ll keep it in mind for more advanced setups.

Thanks again for your help!

– Daniela

This approach also works.

Hi there! :blush:

Thank you so much for sharing this solution — it helped me better understand the logic behind handling multiple products and active orders in Glide. I was stuck trying to delete cart rows after submitting an order, but your explanation about using a Current Order ID in the Users table and assigning it dynamically saved me from a big headache! :grinning_face_with_smiling_eyes:

I’ve decided to rebuild my workflow following your approach. Can wait to see that workflow working!!

Really appreciate your time and help!

Best wishes

Daniela

1 Like