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.

1 Like