I have a collection called ShoppingCart with Product, Size, and Quantity.
How do I increase the quantity if someone adds the same size shirt?
Below is the code for the OnSelect button and is increasing the quantity correctly, but will create another record. How do I get it to just update the record?
UpdateIf(ShoppingCart, Product = DataGallery.Selected.Title && Size = SizeDropdown.Selected.Result, {Quantity: Quantity+1}); Collect(ShoppingCart, {Product: DataGallery.Selected.Title, Size: SizeDropdown.Selected.Result, Pics: DataGallery.Selected.Pics, Quantity: 1})
UpdateIf will not create a record, so there is something else going on in your app if you are seeing a new record created.
I would utilize the monitor tool to start with and see what is going on at the point that you click the button.
I hope this is helpful for you.
@RandyHayes Below is the screenshot of the Monitor tool. I'm not entirely sure how to read this, but can you tell from this screenshot?
So it looks like in that picture that you pressed on a button three times.
The best thing to do is to prepare your app for that point in which you are just about to click the button, then go to the monitor tool and clear the data, then click on the button and see what actions it took.
It does appear though that it is only one row that it is working with, but, since there are multiple actions in that photo, it is hard to tell.
User | Count |
---|---|
261 | |
110 | |
89 | |
54 | |
44 |