Hello PowerApps Community,
I'm building a sort of online shopping cart.
My data source: A SharePoint List that has the item name, details, and quantity
Interface: I'm using PowerApps with a button that patches all items in a collections to a few SharePoint Lists.
I have a collection "colMyOrder' that collects items users want to check out.
There is a "Quantity" text box where the user can add the items they like
There is an "Inventory" field on SharePoint that has the current number of available items
Question: In the SharePoint List, there is a field that has quantity available. When the "Check Out" button is clicked, I would like the "Inventory" field in SharePoint to be automatically reduced by the "Quantity" text box input. I assume that this would be done with a patch functionality.
What I have thus far:
ForAll(
colMyOrder,
Patch(
'Company Store',
{
Inventory0: Value(CurrentInventory.Text) - Qty
}
));
^ With this code, when the "Check Out" button is selected, a new row is created to SharePoint with the Updated Quantity (Qty) instead of pending to the current SharePoint field.
* colMyOrder = my collection
*Company Store = the name of my SharePoint List
*Inventory = name of my SharePoint List Column
*CurrentInventory = a Label on my gallery that has the current Available Inventory
Thanks much!