Limit to add

Hi,

How can I limit just the user (not the admin) to add (hide)new entry after 2PM.

I used the expression : AND((TIMENOW() >= “7:00 AM”), (TIMENOW() < “2:00 PM”)) it works for the admin and the user, I tried the expression: AND((TIMENOW() >= “7:00 AM”), (TIMENOW() < “2:00 PM”),USEREMAIL()=“user”) it worked just for the user but for the admin the add action disappeared before 2PM and after 2PM.
My question is how can I limit to use add action just for the user? Please see below



If you are using the AppSheet choices for Admin and User from AppSheet’s user list, you can user the USERROLE() function to distinguish between those two roles. See the article for more details.

2 Likes

Thank you for your reply,

I used all the options but it’s still not working for the Admin .

The last I used is : AND((TIMENOW() >= “7:00 AM”), (TIMENOW() <= “4:00 PM"),OR((USEREMAIL() = “EMAIL OF THE USER”), (USERROLE() = “User”))) it works for the user but for the Admin the add action disappeared after 7 am and after 4 pm(my goal is for the condition to be applied just for the user not the admin) .
Please advise.

The condition you are adjusting shows and hides the button. I’m reading the above statement that you do not want the button to show for the Admin at all. Is that true?

Or do you want the button to show always for the Admin and for the User only between 7am and 4pm

Regardless, I am including an expression for both

Not show for Admin - Show for any User only between 7am and 4pm

AND(USERROLE() = “User”, TIMENOW() >= “7:00 AM”, TIMENOW() <= “4:00 PM") 

Alway show for Admin but only show for User between 7am and 4pm

OR(USERROLE() = “Admin”,
   AND(USERROLE() = “User”, TIMENOW() >= “7:00 AM”, TIMENOW() <= “4:00 PM")
) 
2 Likes

Thank you for your help it is works Alway show for Admin but only show for User between 7am and 4pm

OR(USERROLE() = “Admin”,
   AND(USERROLE() = “User”, TIMENOW() >= “7:00 AM”, TIMENOW() <= “4:00 PM")
)
3 Likes