Hi,
I'm building an app based on the shopping cart tutorial by Shane Young. (https://www.youtube.com/watch?v=Ztn39KuOW0g)
The items in this web store has a limited quantity and I want the number of items available to update dynamically when changing the number of items in the shopping cart.
The data is stored in a sharepoint list called "Products"
So... I have a label for quantity in stock with the following code for Text: "Quantity: " & ThisItem.qty
I also have a slider for each item set to Max: ThisItem.qty
Then when you add something to the shopping cart (the plus sign) I use the following code for OnSelect: Collect(colShoppingCart; {Title: ThisItem.Title; Manufacturer: ThisItem.Manufacturer; Qty: Slider1.Value});;Patch(Products; ThisItem;{'Qty in stock': ThisItem.'Qty in stock' - Slider1.Value}) - This works well. When adding items to the cart, the value of items in stock updates correctly.
Now to my problems. If you remove items from the cart (code for this is: Remove(colShoppingCart; ThisItem) ) they are removed from the collection BUT I also want the value for quantity in stock to change. I need to pull the value for this item from the collection and add it to the value of items in stock for that same item. That is, I need to patch my datasource (Products) with the current value + the value from the collection.
So to cut a long story short: Is there a way to add a value from a collection back to its original datasource?
