# Submit Order workflow not deleting rows from related Cart group

**URL:** <https://community.glideapps.com/t/submit-order-workflow-not-deleting-rows-from-related-cart-group/83507>\
**Category:** Ask for Help\
**Created:** [July 28, 2025, 8:38pm UTC](https://community.glideapps.com/t/submit-order-workflow-not-deleting-rows-from-related-cart-group/83507 "2025-07-28T20:38:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniela\_D](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniela_d/32/90772_2.png) [@Daniela\_D](https://community.glideapps.com/u/Daniela_D)\
**Post date:** [July 28, 2025, 8:38pm UTC](https://community.glideapps.com/t/submit-order-workflow-not-deleting-rows-from-related-cart-group/83507/1 "2025-07-28T20:38:22Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 29, 2025, 12:44am UTC](https://community.glideapps.com/t/submit-order-workflow-not-deleting-rows-from-related-cart-group/83507/2 "2025-07-29T00:44:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Daniela\_D](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniela_d/32/90772_2.png) [@Daniela\_D](https://community.glideapps.com/u/Daniela_D)\
**Post date:** [July 29, 2025, 6:31am UTC](https://community.glideapps.com/t/submit-order-workflow-not-deleting-rows-from-related-cart-group/83507/3 "2025-07-29T06:31:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [July 29, 2025, 2:21pm UTC](https://community.glideapps.com/t/submit-order-workflow-not-deleting-rows-from-related-cart-group/83507/4 "2025-07-29T14:21:53Z")

</div>

> [@Adding Multiple Products to an order](https://community.glideapps.com/t/adding-multiple-products-to-an-order/73378/5):
>
> The flow would look like this, assuming your users are signed in: Add a Cart table that would contain the order id, the item id and the quantity. In your users table, add a “current order ID” column. Assuming you have an Items screen, on the entry to the details view of that screen, check if your “current order ID” is empty. If empty, set a unique ID to the “current order ID” column, then show them the details screen. Else just show them the details screen without doing anything. Add a form in…

This approach also works.

---

<div class="post-metadata">

**Author:** ![Daniela\_D](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniela_d/32/90772_2.png) [@Daniela\_D](https://community.glideapps.com/u/Daniela_D)\
**Post date:** [July 29, 2025, 5:51pm UTC](https://community.glideapps.com/t/submit-order-workflow-not-deleting-rows-from-related-cart-group/83507/5 "2025-07-29T17:51:35Z")

</div>

Hi there! 😊

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! 😄

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
