Clear Many-Many Relationship Property

Does anyone know if there is a way to use an action (either on screen load or component click) that will let you clear/remove a many-many relationship field’s values?

Example I have in mind is my users have a many-many relationship to the category collection. I want to send my users to a screen, where they use drop down menus to update the connected categories to that user’s account. As it stands right now, if I sent users to a screen, there’s no way to simply remove the existing category relationships to each user so that when they complete the form it replaces the existing selections. Right now it would just add new selections to that property in the User collection.

Unfortunately there is no way do this currently, but you can upvote batch actions here.

One workaround is to create another “carrier” collection that holds these categories for the user so that the user only has 1 of these “carrier” records, but the carrier record is attached to multiple categories. Then you can look up a user’s categories through the carrier record.

When you need to reset the categories you replace the user’s Current Carrier record with a new one and all categories are gone.

2 Likes

Hey I have a similar issue with regards ton wanting to clear a many-to-many relationship. I wonder if the feature dropped and if it didn’t if you could give me a hand with a workaround please.

My use case is that my users connect to each other through a collection called “Sessions” to answer Quizzes. I have an “Answers” collection where all of the user answers get stored to be able to show results once they’ve both answered.

So there is a many-to-many relationship between “Sessions” and “Answers” however I would like to be able to clear all the answers when they start a new quiz in the session.
But when I try to do that it only gives me the ability to delete “Current Answer”.

Any help would be appreciated! Thanks in advance.