How to delete a favorite product

Hi!
I want to create an add to favorite system were users can Click the Heart icon on the product and the product is added to their Favorite Products but another thing that i need is to delete the product from favorites if the heart icon is clicked 2nd time.
I have created a workflow with an Create a new thing action to add the product to favorites and is working but i just cant make an action to delete the product from favorites.
Thank you!

You can Delete thing action and search for the correct favorite product.

I tried with delete thing but it was deleting my product from the database.

Don’t delete the Product, just delete the Favourite_Product.

You may also want to split this on to two separate workflows, one for adding, one for removing , each one with it’s own triggering condition on it - else you could run into issue where, if run subsequently, it creates AND delete in the same flow, which will cause you issues.

There are other ways to achieve this too, for example you could set a state in the first step to do the check if it already exists , and then refer to this state on your following conditions.

As you build this, you’ll have to think about other things as well - like stopping users spamming the buttons, wracking up WUs. This part of my app was quite a journey tbh and taught me a hell of a lot about bubble. Sounds simple on the surface but a lot to consider especially if making it scalable. Good luck :crossed_fingers:t2: