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

0 12 237
12 REPLIES 12

  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] ) , "," ) )
)

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.

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

3X_9_3_935bd4e21713a8aa8a95fe9d40d5bdb6578c9e31.jpeg

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()
)

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.

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.

Top Labels in this Space