Checking a value against an enumlist for a security filter

Hi & Thanks in advance. I am trying to check a value in an enumlist for a security filter, it works when the enumlist has one value the check works, but when enumlist has multiple values it doesnt work here is the expression:

Dept has a single value, Assigned Depts can have multiple values.
IN([Dept], SELECT(User List[Assigned Depts], [Email] = USEREMAIL())) where Dept is a single value and Assigned Depts has multiple values.
Alternatively I have also tried using a count but that doesnt work either

COUNT(SELECT(User List[Assigned Depts], AND([Email] = USEREMAIL(),IN([Dept],[Assigned Depts])),TRUE)) >0
what am I missing here?

A SELECT() on an enumlist column creates a list of lists. One needs to flatten this list by using a SPLIT() function.

There are many posts on this issue.

Search - Google Cloud Community

So you could try

IN([Dept],

SPLIT( TEXT(SELECT(User List[Assigned Depts], [Email] = USEREMAIL())), " , ")

)

SPLIT() - AppSheet Help

You may also wish to explore using the following epic tip for such USEREMAIL() based selections

Current User (Slice) | How to conform your app a… - Google Cloud Community

2 Likes

Great thank you that worked.

2 Likes

You are welcome.

1 Like