Hi. I'm using the security filter to filter r...

Hi. Iโ€™m using the security filter to filter rows a user sees. I have set up a rule which should return โ€œYโ€, but returns โ€œNโ€. You can see the userโ€™s ID in the list (ne of two key). Can anyone explain why this us returning โ€œNโ€?

0 9 423
9 REPLIES 9

I donโ€™t have permission to view the image.

Could you post the expression your are using? Also have you tried using the expression tester to debug it?

Hi Guys. Iโ€™ve tried to give permissions to the image that shows the results of the test of the expression. The Expression passes the syntax check and itโ€™s the โ€œTestโ€ that doesnโ€™t provide the expected result. Iโ€™m wondering if I need to use โ€œINCLUDESโ€ rather than โ€œINโ€? The list I am checking for the inclusion of the key is returned from an inline list from a referenced table. (The โ€œUserโ€ is a โ€œTeam Memberโ€ and their ID is in the โ€œTeam Members Listโ€ which is a Slice).

First try to type the formula with fixed user ID, like IN(โ€œIWIqJbWEโ€,โ€ฆ) so you would have a hunch which one could be the reason.

@Aleksi_Alkio Thanks. Iโ€™ve figured it out. Rather than using โ€œINโ€, I need to use โ€œCONTAINSโ€. Iโ€™m guessing this is because, rather than being the result of a SELECT, and therefore a true List, this series of IDโ€™s returned from the referred table is simply a comma-delimited string, and not a true List. Iโ€™ve changed to โ€œCONTAINSโ€ and itโ€™s now working as expected.

If the โ€œlistโ€ is coming from the one text cell, you could read the โ€œlistโ€ with the IN expression likeโ€ฆ IN([User],SPLIT(LOOKUP(โ€œKeyColumnValueโ€,ThisAppUserMonitoredTeams,KeyColumn,Team Members)," , "))

@Aleksi_Alkio Thanks. The value Iโ€™m looking for ([User]) is actually the ID thatโ€™s already in the string, so I donโ€™t need to look up another value from the table. Good to know I can though, if I need to somewhere else. Thanks!

@Stephen_Robb, @Aleksi_Alkioโ€™s suggestion to use SPLIT() and IN() is a good one. Using CONTAINS() could result in false positives if the userโ€™s name is short and may occur as part of some longer name (e.g. โ€œstevenโ€ contains โ€œsteveโ€ but isnโ€™t an exact match).

+Steve Coile Thanks Steve. Note that Iโ€™m using keys (generated using UNIQUEID) rather than actual names, so no chance of false positives in this instance. I wasnโ€™t aware of the LOOKUP function though, but have already been able to use it in a couple of instances to make things more streamlined.

Top Labels in this Space