Help with user role/access to a Table

I need help with a formula or code that grants specific useremail() access to edit a table.

The table is currently READ_ONLY to all USEREMAIL() but need a code that will allow USER1 only to edit Table whiles it still remains READ_ONLY to USER2, USER3 & so on…

Any help will be appreciated very much

Hi @Robert_Addo_Darko,

Welcome to AppSheet community.

Please go to Data --> Table option --> Are Updates Allowedoption and please write an expression something like below

SWITCH(USEREMAIL(),
user1@mydomain.com”, “UPDATES_ONLY”,
“READ_ONLY”)

If you wish USER 1 to only edit the records and not add to it. Here “user1@mydomain.com” is the email of the USER1. Other users will have READ_ONLY access.

OR

SWITCH(USEREMAIL(),
user1@mydomain.com”, “ALL_CHANGES”,
“READ_ONLY”)
If you wish USER 1 to add, edit and delete the records. Here “user1@mydomain.com” is teh email of the USER1. Other users will have READ_ONLY access.

Please take a look at following articles too.

4 Likes

This means a lot. Thanks for the help. Tried to use this expression earlier but didn’t understand it. Thanks for the explanation.

Much much appreciated :heart:

1 Like