Best way to update inventory table with ordered items

Hey guys!

I’ve created the image below, hopefully it helps.

Question: Is there a way to update the inventory table when the “shop owner” updates a cart to paid/delivered? (Currently just using the edit form component to change the status in the cart)

Or, when the customer confirms their cart?

I think I could work out a way to do it by adding all items that go to CartItems table to the inventory table in the same “action” but that seems clunky.

CartItems and cart are linked via a unique ID from User Profile.


I think you can use a relation & rollup from the Inventory table to the CartItems table and sum all the items where their cart status is Paid/Delivered?

You might want to have another table to track manual inventory updates as well that the owner can add to. Say I add 100 items of item A, or remove 50 items of item B, then that table will store such type of info.

Overally, your live inventory item will be calculated by Total items added manually - Total items paid - Total items removed manually.

1 Like

Thanks for this!

How would I include the “filter/rule” if the status is paid?

You can use a query instead of a relation if you need additional criteria.

1 Like

Here’s a docs link.

1 Like

Epic thank you! This will be my first time testing out the Query Column