Security Filter Expression Strange behanvior

Hello Everyone,

Just tried to launch my online for our vendors and No can Do.

Very Strange,

I have a security Filter than is the Following

OR(In(useremail(),Admin Emails[Email]), In([ID], SELECT(Security Filters[Vendors], [email]=useremail())))

Note, this expression could significantly impact sync time.

ANY of these statements is true:
โ€ฆ1: (USEREMAIL()) is one of the values in the list (ADMIN EMAILS[Email])
โ€ฆ2: (The value of column โ€˜idโ€™) is one of the values in the list (The list of values of column 'Vendorsโ€™
โ€ฆfrom rows of table 'SECURITY FILTERSโ€™
โ€ฆwhere this condition is true: ((The value of column โ€˜Emailโ€™) is equal to (USEREMAIL())))

Admin Emails Work perfecly, Everyone onsite here can see everything. I removed my own email from admin emails and added to a few vendors in the Security Filter Table, and this works completly fine, problem is when somone elses email is added to security filter table for certain vendors they see nothing.

Security Filter Table
2X_8_80bb1bddc4ff84ad28540a76c850186f802856cd.png

Vendor Table
2X_e_e151fe4f457075acae82cbdd869f55345537890f.png

Iโ€™m have no idea what Iโ€™m doing wrong and thought i had it all figured out. Also tried contains etc but to no avail. I dont understand why it is working for my email and not for others. Extremly frustrating. Ugh

Solved Solved
0 2 267
1 ACCEPTED SOLUTION

tony1
New Member

Hi @Jonathan_S. What type of column is Vendors? The fact that itโ€™s plural makes me suspect that itโ€™s an EnumList. If thatโ€™s the case, then SELECT(Security Filters[Vendors], [email]=useremail()) will return a list of EnumList values. That means youโ€™re checking to see if ID is in a list of EnumLists, which will always return false.

If thatโ€™s all correct, then I could see two different ways of fixing this:

(1) Change your security filter to check to see if there are any rows that have ID in their vendor lists. Something like this:

COUNT(
  SELECT(
    Security Filters[Id],
    AND([email] = USEREMAIL(), IN([_THISROW].[ID], [Vendors]))
  )
) > 0

(2) Change your Security Filter table to have a single vendor per row (instead of an EnumList). Then your security filter would have something like:

IN([ID], SELECT(Security Filters[Vendor], [email] = USEREMAIL()))

(note that Vendor is singular - thatโ€™s the change to your schema).

View solution in original post

2 REPLIES 2

tony1
New Member

Hi @Jonathan_S. What type of column is Vendors? The fact that itโ€™s plural makes me suspect that itโ€™s an EnumList. If thatโ€™s the case, then SELECT(Security Filters[Vendors], [email]=useremail()) will return a list of EnumList values. That means youโ€™re checking to see if ID is in a list of EnumLists, which will always return false.

If thatโ€™s all correct, then I could see two different ways of fixing this:

(1) Change your security filter to check to see if there are any rows that have ID in their vendor lists. Something like this:

COUNT(
  SELECT(
    Security Filters[Id],
    AND([email] = USEREMAIL(), IN([_THISROW].[ID], [Vendors]))
  )
) > 0

(2) Change your Security Filter table to have a single vendor per row (instead of an EnumList). Then your security filter would have something like:

IN([ID], SELECT(Security Filters[Vendor], [email] = USEREMAIL()))

(note that Vendor is singular - thatโ€™s the change to your schema).

Thank you sir

Top Labels in this Space