Delegate Access for a Reservation App

Hello Everyone,

I am building a Reservation App to book workstations and would like to assign a security filter with a condition that will allow the primary user ( for self) and only their delegate users (on behalf of the primary user) to book a station. The expression used is

OR(IN(USEREMAIL(),SELECT(ASET Users[Primary Email],TRUE)),IN(USEREMAIL(),SELECT(ASET Users[Delegate Email],TRUE)))

It worked as expected and when I tested today, this is no longer functioning. Would appreciate it if someone can assist with this ask.

And, I would also like to know if one primary user can have multiple delegate users that can manage the booking for them.

Thanks and I will look forward to hearing from you.

Regards,
Arun
State of Arizona

  1. SELECT( Table[Column] , TRUE) is equivalent to simply Table[Column]. It’s always best, for code-readability, to use the simplest form of the required expression.

  2. If [Delegate Email] is an EnumList , then you’re probably having issues with a “List of a List”. To counter this, you can use CONCATENATE() to convert the List of a List into a simple Text string, then SPLIT it back up.

Both items together, I’d recommend trying this expression:

OR(
  IN( USEREMAIL() , ASET Users[Primary Email] ) ,
  IN( USEREMAIL() , SPLIT( CONCATENATE( ASET Users[Delegate Email] ) , "," ) )
)
2 Likes

Thank you very much, Marc. I did try this expression but this still does allow a non-delegate user to book on behalf of a primary user.

For any further help, you’re going to have to provide more detail about your app setup and what you’re trying to do. Please use screenshots.

1 Like

Absolutely, mine is a booking app and objective is to use for booking workstations for our hybrid work model.

The specific requirement is " As a user, I should be able to delegate the reservation rights to another user so that the reservation can be booked on my behalf".

In order to meet this req, I have a table “ASET User” created with the Primary User Email mapped with the Delegate User Email. Besides the Primary user booking for self, in addition to it I only want the designated delegate user to book on the primary user’s behalf (No other user should be able to book on the Primary user’s behalf)

Please refer to the screenshot of the table and let me know if you need any further clarification and your help is much appreciated.

Regards,
Arun

Since I wasn’t able to embed two screenshots , I am sending the table with this reply. Excuse the typo on my previous reply, that screenshot was Booking Form

TEST-Stations-ASET-Google-Sheets

Hmm, ok.

I don’t think you’re understanding what Security Filters are for. Make sure to re-read this doc:


What I think you are actually wanting is a Valid_If expression for the “Booked For (email)” column, that will give options for yourself, as well as anyone who has delegated you for themselves (I may have gotten that backwards). Possibly something like this:

LIST(  USEREMAIL() )
+
SELECT(
  ASET User[Primary Email] ,
  [Delegate Email] = USEREMAIL()
)
2 Likes

Marc,

It worked and I am able to restrict the primary user’s booking to the self and the listed delegate/s. I did notice, the Booked For(Email) field is available only in the preview and disappears when opened in the browser. I am embedding the screenshots for your reference, what could have caused this behavior?

Browser often doesn’t update to newest version right away. Please force-refresh your browser, possibly with Ctrl-F5, and do a manual sync.

3 Likes

I appreciate your assistance, Marc.I reopened the browser after making the updates, but I did figure out this morning that the Booked For(Email) field appears only when there is a delegate assigned to a primary user.

Ah, yes. In some cases, Appsheet will auto-hide a column if there is no possible value that can be entered into it, such as if the valid_if returns a blank List.

1 Like