Hi,
I've got two list. One that stores the ordered items with the ordered amount. In the second list I've got all my products.
In my ordered items list I've also stored the ID of the products from my productstable once an order is placed.
Now I want to do the following: I want to reduce the available amount of the product by the ordered amount of this product which is stored ordered items list.
My ordered Items List is looking like this
| Title | Amount | Order ID | Product ID |
| Product A | 2 | 1 | 4 |
| Product B | 4 | 1 | 2 |
| Product XY | 5 | 2 (different Order) | 6 |
My Product List looks like this:
| Title | ID | Amount | |
| Product A | 4 | 100 | |
| Product B | 2 | 50 | |
| Product XY | 6 | 10 | |
The order can have various products and for all those ordered products I want to reduce the amount in the product list by the value of the ordered amount.
I know that I have to somehow compare the two tables by ID and then update the amount if there is a match. But I don't find the correct formulas.
Thanks in advance for your help.