App Hanging when using Security Filter

I have the follows:

  1. Top tier table "Owner"
  2. Second tier table "Users"

The "Owner" table has a field to accommodate the owner's users emails injected through bot and automation as shown below:

Users Security filter -2.jpg

 

When i use the below security filter on "Users" table the app works fine if i logged in with "someone@gmail"

Users Security filter -1.jpg

But if i used any of the user's emails the app gave me the below message:

Appsheet Error.jpg

I am also adding a phot to my "Users" Table for reference:

Users Security filter -3.jpg

Kindly, assist on that matter.

Thank you

0 10 256
10 REPLIES 10

Hi Hani,

Would you please copy/paste the complete IFS() statement you are using? The screenshot is truncated. Thank you!

ุชุญูŠุง ู…ุตุฑ ๐Ÿ™‚

Good morning,

This is the entire โ€œIFSโ€ statement. I just moved the last arrow to match with the ifs.

ุชุญูŠุง ู…ุตุฑ ๐Ÿ™‚

IFS(
USEREMAIL()="arch.hany@gmail.com",
TRUE,


IN(USEREMAIL(), OWNER[Owner Authorized Email List]),
[Owner id]=ANY(SELECT(
OWNER[Owner_id],
IN(USEREMAIL(), OWNER[Owner Authorized Email List]))

),
)

Thank you!

I see two things:

  1. Your security filter condition should either return TRUE or FALSE. The problem with your IFS  expression is that it can return TRUE, but otherwise it will never return FALSE. You have to  add another line at the end of your IFS statement:


    TRUE, FALSE

  2. Also, I believe there's a logical problem. It might not cause the security filter to fail, but it  could lead to undesirable results. It is not only that the exact IN() condition is used twice, but  more importantly the SELECT statement will either return all rows of OWNER table or none,  because its condition is not testing the rows and has actually nothing to do with them. I  believe you should rewrite this. 

 

Your expression can be simplified:

OR(
  USEREMAIL()="arch.hany@gmail.com",
  IN(
    [Owner id],
    SELECT(
      OWNER[Owner_id],
      IN(USEREMAIL(), OWNER[Owner Authorized Email List])
    )
  )
)

It looks tidy with your suggestion ๐Ÿ˜,

i will try it.

Dear @Steve, sorry if I'm missing something very obvious, but I can't see how the SELECT expression would work; the outcome of its condition is independent of the row column values. 

I see this expression equivalent to:

OR(
  USEREMAIL()="arch.hany@gmail.com",
  AND(
    IN([Owner id], [OWNER[Owner_id]),
    IN(USEREMAIL(), OWNER[Owner Authorized Email List])
  )
)

 

Good point! I just restructured the original expression; I didn't consider whether it would do anything meaningful. ๐Ÿ™‚

Really, appreciate your feedback and respected advice, i will do think in it again with different approach. 

thank you for your valuable time. 

I see, thank you ๐Ÿ™

Top Labels in this Space