Security filter on a table. Which expression is more efficient, or does it matter?

update: data is in a google sheet.

Security filter on a table. Which expression is more efficient, or does it matter?

LOOKUP(USEREMAIL(), โ€œUsersโ€, โ€œUSER_EMAILโ€, "PI_NOโ€)>=15

My User[PI_NO]>=15
where slice My User only contains the current userโ€™s info based on Row Filter: (USEREMAIL() = [USER_EMAIL])

Of course, this assumes that I wrote the expressions correctly.

0 3 408
3 REPLIES 3

This article seems to indicate that security filters are applied before sending the data to the app. I would assume that the calculation of which records are in the slice, would be part of the appโ€™s calculation after the security filter is applied. So my guess would be to use your LOOKUP() expression. โ€œGuessโ€ being a key word here though. Would be very interested in other peoplesโ€™ responses as well.

@Marc_Dillon Youโ€™re right when you say

But you actually CAN use slices inside the security filter formula - AppSheet has handled all the order of operations to make sure everything is handled correctly and the appropriate security criteria is followed - even if thereโ€™s slices and virtual columns that need to be calculated first.


For instance, the following security filter is on the Clients table of my Time-Tracking app

You can see I make user of โ€œCurrent_Userโ€ - a slice of the User table - and a column called [Auto_Status] (which is a virtual column). So when loading the app, the following must happen:

  1. The user table is loaded (no security filter on this table - as Iโ€™m using it to determine whoโ€™s-who)
  2. The virtual columns of the User table must be formulated (because I make use of a virtual column for the security filter)
  3. The Current_User slice must be evaluated and populated (because itโ€™s used in the filter)
  4. Then the security filters can be applied

This is an older out-dated formula that needs to be reformulated to be more efficient

But it getโ€™s my point across.


I should also point out that in my case, I need all the records in the user table so I can accomplish other tasks.

I would do it in this wayโ€ฆ

First use a security filter with your โ€œMy Userโ€ table as USEREMAIL()=[User Email].

In the other table useโ€ฆ
ANY(My User[PI_NO])>=15.

Because you have only one record in โ€œMy Userโ€ table, ANY will pick that record.

Top Labels in this Space