Hello AppSheet community,
I'm trying to create an expressionin in
Display > Behavior > "Only if this condition is true".
Here are the details:
I've tried using the following expression, but it's not working as expected:
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! Go to 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!
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
User | Count |
---|---|
17 | |
12 | |
5 | |
5 | |
5 |