Check if collection is already present

Actions & Logic

Hello everyone,

I need your help, as I don't know what to do to solve this problem. I'm new to development and I'm having a hard time. I've created a shopping application in which I have two collections. One is for products, called Items, and the other is called Selected Items, which contains the products added to the cart.

The problem I'm encountering is that when I press the button to add to the cart, it should check if the product already exists in the Selected Items collection, and if it does, it cannot be added again to that collection. Does anyone know how I can solve this?

Thanks in advance.

What have you tried so far?

I have tried checking the collections in the database so that if the references in both collections match, it updates and does not create a new record. I have also tried comparing unique identifiers, but that hasn't worked either.

Did you check FlutterFlow's Documentation for this topic?
No
1