Hi @dylandavis09, 😊
As I mentioned in your previous topic, a variable will unfortunately not work when working with a gallery / an array of data. The variable is global and will not be specific to one item - you will need to keep track of the quantity for each item individually. You could create a collection from your gallery data (Items property) and add a column to keep track of the selected quantity.
(1) OnVisible of that screen
//Should you already use a collection for the gallery - make sure to just add the AddColumns as below (don't create a new collection)
//Add a quantity column to keep track of the added numbers for each item
ClearCollect(
colShoppingCart,
AddColumns(
<Items property of gallery>,
"Quantity",
0
)
)
(2) Set your gallery Items property to the new collection
colShoppingCart
(3) OnSelect of the Up arrow
Patch(
colShoppingCart,
ThisItem,
// -1 for the down arrow
{Quantity: ThisItem.Quantity + 1}
)
(4) DisplayMode of the Down arrow (to avoid quantities below 0)
If(
ThisItem.Quantity = 0,
DisplayMode.Disabled,
DisplayMode.Edit
)
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!