Limit Users saved in an EnumList to their own data

Ksenia1
Participant V

I have a table for my buildings and a table for Persons. Buildings has a column where several Persons can be added (Type EnumList, Base type Ref, referenced table Person). Now I want to limit Users to their own data allowing them only to see the buildings in which they are added. The expression
IN([Person], SELECT(Person[Id], [Email] = USEREMAIL()))
taken from the documentation Limiting Users to Their Own Data | AppSheet Help Center works well for only one entry in the enumList column but not when there are multiple entries. Can anyone help with the right expression?

Solved Solved
0 2 161
1 ACCEPTED SOLUTION

Your expression would need to be like this:

IN(ANY(SELECT(Person[Id], [Email] = USEREMAIL())), [EnumListColumn])

Using SELECT() returns a LIST and in this case a LIST of a single value. The ANY() function returns the FIRST listed value from that list.

View solution in original post

2 REPLIES 2

Your expression would need to be like this:

IN(ANY(SELECT(Person[Id], [Email] = USEREMAIL())), [EnumListColumn])

Using SELECT() returns a LIST and in this case a LIST of a single value. The ANY() function returns the FIRST listed value from that list.

Perfect! Much appreciated @WillowMobileSystems

Top Labels in this Space