Filter Data based on Team/Dept or Category

Challenge Summary:
I want to do some level of role-based access control for my data as per below.

Here is my setup:

Table 1 (Contacts) - with columns Name, Phone, Address, Country etc…

Table 2 (Volunteers) - Names, Email Address, Team(s) they are part of by country etc… A volunteer might just be part of one Team (i.e. USA) or multiple Teams (i.e. USA, UK or ALL).

The two tables are not related to each other but can be if absolutely required.

Here is the problem I am trying to solve:

Once the volunteer opens the app, they should only see contacts that are in the country or countries the volunteer as been assigned to.

For example,

  • Volunteer1 is assigned to USA Team and therefore only USA contacts should be visible
  • Volunteer2 is assigned to USA and UK Teams and therefore any USA or UK contacts should be visible.
  • Volunteer3 is assigned to ALL Team and therefore they should see all contacts regardless of the country listed in the contact record.

My approach and where I need help:

Based on above, I thought the best way to do this might be to:

Create a slice where an expression filters data by:

  1. Checking the logged in Volunteer by USEREMAIL()
  2. Looking up in Table 2 what Team or Teams the user is assigned to (maybe via LOOKUP()).
  3. Filter so the country of the contact matches country or countries the Volunteer is assigned to.

Any help would be greatly appreciated.

Thank you,

Solved Solved
0 10 1,043
1 ACCEPTED SOLUTION

Thank you Steve. This is perfect. Works exactly as intended.

View solution in original post

10 REPLIES 10
Top Labels in this Space