Add only unique items to cart

I’m not running an e-commerce store but I’m using the add to cart method, basically its like a Netflix type platform displaying tv and film, click on title and it has an IMDb style page about the selected content. its set up like Netflix where you can browse content and click add to list, so clients can build a list of titles they want to licence, then on the cart page it displays this list and there’s a submit button that sends the list to us in an email.

this all works fine so far, however, how do I make it so it only adds the title to the list if it doesn’t already exist in the list?

for example, on the homepage there’s a RG displaying action titles and another RG displaying adventure titles. if a movie has both of these genres in the metadata it will appear in both RG’s, and if I click add to list on this title in both RG’s then I end up with 2 entries for the same movie. I’m not sure on the workflow, do I prevent it from adding to duplicates to the list or remove duplicates after? how would this be achieved?

this is how the DB is structured:

and the add to list workflow:

ok I figured it out, I simplified the data structure, only have 3 data types now Metadata (list of films) User with a field Cart with a field type list of Metadatas and final data type Orders also containing list of Metadatas.

add to list button adds directly to the Users Cart, on the cart page display the Users Cart in an RG.

add to list workflow is now just 1 step that adds the item to the cart only when the unique ID of the item does not exist in the cart already.

this seems to work, though do let me know if I’ve made a mistake with this new workflow, I am new to bubble!

1 Like

just realised through some testing this didnt work as planned, this is the correct way, not sure why i didnt do it this way to begin with!