I have two screens:
Screen 1- Have details of item (item name and item image) and button, when I press the button (add to cart) it adds the item name and image to the gallery (colProducts) on another screen.
Screen 2- Have gallery (colProducts) that display all items added to gallery that's coming from the add to cart button on screen 1.
I want to do a check first on the button on screen 1 to check if the item I am about to add already exist in the gallery (colProducts).
The current code I have on the button is "Collect(colProduct, {itemName: thisTitle, itemImage: thisImage})"
This adds the current item to the gallery but when I press the button again, it adds another duplicate entry to the gallery.
How can I check using an if statement if the record already exist?