Logic: How to substract amount of products in Inventory collections when the order is created?

I study features FlutterFlow for eCommerce.

For example, I have 2 collections: Orders and Inventory

Orders
product_id
amount

Inventory
product_id
amount

When the order is created amount of products in Inventory is substracted by number of products in order.
For example,
There were 100 things of a product in inventory. The User has made an order of 5 things. There were 95 products remaining in inventory.


How to build this logic in Actions?
I understand how to build this logic on Backend with API but I haven't the solve how to do it with Actions.

1
8 replies