Adding/Removing Users to a Project

I am working on a client portal where users are assigned to a client. When a new project is created, all users for that client are included to the new project by default. I want to be able to remove certain users from certain projects, but not from the client account.

I am trying to accomplish this through a table collection of client users with a “Remove” button that will exclude the user from the project. Since the collection is pulling from the Users table, I am thinking that I can achieve this by adding/removing project ids from a set that would represent the excluded projects.

Adding an exclusion:

  1. Admin clicks remove on user table (in a project view)
  2. Project ID (extracted from link to current screen) is added to a set that represents the excluded projects for that specific user

Removing an exclusion:

  1. Admin clicks include on user table (in a project view)
  2. Project ID (extracted from link to current screen) is removed from the set that represents the excluded projects for that specific user

What columns/actions do I need to achieve this? Are sets the best tool to achieve this?

I know I could achieve something similar with a Choice component that writes/deletes the user IDs from a text column, but I am really looking to achieve this through a collection view so the Admin has more user context.

Thanks.

I would do it like this:

  • Add the projects as usual.
  • Use relation + lookup to pull over the list of IDs that should have access (as an array).
  • Add a column for excluded IDs, and have a multiple choice component, sourced from the list of people who should have access. You would then have a comma-delimited list of excluded IDs.
  • Add a Split Text column to get an array of excluded IDs.
  • Use the “Remove Elements” column to remove the excluded IDs from the lookup source.
  • Use a relation from the removed elements column above, back to the Users table, to display the final access list.

Thanks for the input. That is similar to the solution I am currently using. I was looking for a solution that I could implement directly into the collection as opposed to using a choice component.

I think I can achieve this through adding/removing elements to sets, but I need to better understand how to exclude/include multiple elements from a set instead of just the most recently selected item.

Is the problem just about the look of the choice component? I think doing it your way adds a level of complexity to how you structure the actions.

I did almost the same thing your way in a recent project though, but it was one where I chose users to add to projects when I create it, so it’s a bit different to this case.

It’s more of a layer of complexity for the user who is updating. We need a collection view on the front end to display some additional user info so the action of adding/removing users will have to live on an alternate screen (overlay) that displays the choice component when an edit button is clicked.

My hope was that updating could take place directly through the collection instead of having to click an edit button that displays an overlay with the choice component, but it is not the end of the world for the initial version to have the 2 step process of clicking an edit button, then selecting/deselecting the users. It does not occur very often.