Clearing a relational value from a record

I can’t seem to find a way to clear a relational value field.

I have a DB table that has a user-related to it, but under some circumstances, i need to remove that user.

On that particular screen, you must make sure that you have the current user and the collection that has a relation to that current user.

Only then, you can bind an action to a button or component to remove the current user from that collection’s relation with users.

For eg. You have a “Flights” collection that has a many to many relationship with users.

For the user, it’s quite simple. Just display a list of flights that belong to the logged in user. Add a delete button beside the flight, and trigger an action to remove logged in user from the current flight.

For admins that want to remove another user from a flight, there’s an additional step.

On tapping on a specific flight in the list, it should send the admin to a screen with a list of users attached to that flight. Beside each user is a delete button. Tapping on the delete button should remove the current user from the current flight.

Hope that helps!

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.