How to restrict users list to the company of the logged in user

Hello I have an app with groups so I have a security filter that restricts the information to that particular group based on the user thatโ€™s logged in. The security filter is: LOOKUP(USEREMAIL(),โ€œgroup_usersโ€,โ€œuserโ€,โ€œgroupโ€)=[group_id]

Question 1: Is there a less expensive expression I can use?
Question 2: I now have to restrict the โ€œgroup_usersโ€ table to only show users in the logged in userโ€™s company.

The above expression no longer works of course as weโ€™re IN the table so it would be great if we use something like LOOKUP(USEREMAIL(),[_THIS],โ€œuserโ€,โ€œgroupโ€)=[group_id] but that doesnโ€™t work either.

Any ideas?

Thank you

0 6 309
6 REPLIES 6

You could add a column with all emails of the group as an ENUMLIST and check if USEREMAIL() is in that column

Isnโ€™t the filter just
[user] = USEREMAIL()

Steve
Platinum 4
Platinum 4

What concerns do you have about the current one? The only question that jumps to mind for me is can the user belong to more than one group?

If by โ€œcompanyโ€ you mean โ€œemail domainโ€ (the part after the at sign (@)):

(
  INDEX(SPLIT(USEREMAIL(), "@"), 2)
  = INDEX(SPLIT([email], "@"), 2)
)

yes, the user could belong to more than one group
CORRECTION: the user can only below to one group

Hi Steve, weโ€™ll use the LOOKUP expression as you are correct, users belong to only one group.

@praveen the user will need to see all users for their group

I think I can use USERSETTINGS to capture the group the user is associated and then call on USERSETTINGS (group) as needed. Iโ€™ll update the note if successful.

UPDATE: USERSETTINGS() doesnโ€™t work - seems to be a circular reference issue.

Thanks

So where do we stand now?

Top Labels in this Space