Help with Expression for Admin-Only Action in AppSheet

Hello AppSheet community,

I'm trying to create an expressionin in
Display > Behavior > "Only if this condition is true".
Here are the details:

AbdullaNsour_0-1698678356869.png

  1. Table Name: User Manager
  2. Column Name: Role

I've tried using the following expression, but it's not working as expected:

 

 
"Admin"=ANY(User Manager[Role])

My goal is to allow only administrators to perform this action. If the user's role is "Admin" in the "Role" column of the "User Manager" table, the action should be available to them.

Could someone please help me with the correct expression or provide guidance on how to achieve this in AppSheet? Your assistance would be greatly appreciated!

Thank you.

Solved Solved
0 2 422
1 ACCEPTED SOLUTION

This portion of your expression, User Manager[Role], simply retrieves a LIST of all the [Role] column values.  The ANY() function returned the FIRST item from that list.

Somehow you need to tie this back to the logged in user.  You haven't said how you are using the User Manager table.  Let's assume you have a column in User Manager for [Email] which is the log in email.  Then you could have an expression like this:

ANY(SELECT(User Manager[Role], [Email] = USEREMAIL())) = "Admin"

I hope this helps! 

View solution in original post

2 REPLIES 2

This portion of your expression, User Manager[Role], simply retrieves a LIST of all the [Role] column values.  The ANY() function returned the FIRST item from that list.

Somehow you need to tie this back to the logged in user.  You haven't said how you are using the User Manager table.  Let's assume you have a column in User Manager for [Email] which is the log in email.  Then you could have an expression like this:

ANY(SELECT(User Manager[Role], [Email] = USEREMAIL())) = "Admin"

I hope this helps! 

yes yes.. it's worked thank U

Top Labels in this Space