How to subtract a selected number from a set quantity?

hi I was wondering On the 'Input Page', I enter a specific ID and quantity of goods. When I select that item ID on another purchase page I want to bring up the item and enter the purchase quantity within the item quantity. And I want to know how to subtract the quantity of that ID item from the purchase quantity and save it.   Please let me know in which format I should configure the microflow If there is another way to do this other than a microflow, that's fine too.   If you can give me an example, that would be even more appreciated.
1 answers

I believe, in you 1st input page you are creating you inventory any managing your product availability list. After providing the product ID and quantity, please save the same into your DB. Because this inventory will use for your remaining shopping card functionality.

In the second page which you have mentioned its look like shopping card or page where user is going to select product name/ID and then avail to see the product detail. You can use the reference selector to give the product list in your shopping page. After selecting an item, display product reference information and then after adding a input field for purchase quantity. Create an action button with link of microflow to verify available quantity verification. If product available as per purchase quantity request, add the item into your card and calculate total price for the card.