Announcements
The Google Cloud Community will be in read-only from July 16 - July 22 as we migrate to a new platform; refer to this community post for more details.

'Are updated allowed' Expression based on Roles, not emails

PG3
Bronze 3
Bronze 3

Hi there,

I am looking for an Expression for the update mode in a table based on Roles in a Permission table rather than based on email addresses.

Want I ant to achieve:

  • Allow ADMIN Role in Permissions table (ID, Role, Email) to have ALL CHANGES rights
  • Allow all USER Roles in Permissions table (ID, Role, Email) to have only ADD and UPDATE rights only
  • Allow PM Role in Permissions table (ID, Role, Email) to have UPDATE and DELETE rights only

Thanking you in advance.

Solved Solved
0 1 145
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

Hi @PG3 


@PG3 wrote:

 

  • Allow ADMIN Role in Permissions table (ID, Role, Email) to have ALL CHANGES rights
  • Allow all USER Roles in Permissions table (ID, Role, Email) to have only ADD and UPDATE rights only
  • Allow PM Role in Permissions table (ID, Role, Email) to have UPDATE and DELETE rights only

 


Can you try:

SWITCH(LOOKUP(USEREMAIL(), "Permissions", "Email", "Role"), 
  "ADMIN", "ALL_CHANGES",
  "USER", "ADDS_AND_UPDATES",
  "PM", "UPDATES_AND_DELETES", 
  "READ_ONLY")

 For reference:

LOOKUP() - AppSheet Help

 

View solution in original post

1 REPLY 1

Aurelien
Google Developer Expert
Google Developer Expert

Hi @PG3 


@PG3 wrote:

 

  • Allow ADMIN Role in Permissions table (ID, Role, Email) to have ALL CHANGES rights
  • Allow all USER Roles in Permissions table (ID, Role, Email) to have only ADD and UPDATE rights only
  • Allow PM Role in Permissions table (ID, Role, Email) to have UPDATE and DELETE rights only

 


Can you try:

SWITCH(LOOKUP(USEREMAIL(), "Permissions", "Email", "Role"), 
  "ADMIN", "ALL_CHANGES",
  "USER", "ADDS_AND_UPDATES",
  "PM", "UPDATES_AND_DELETES", 
  "READ_ONLY")

 For reference:

LOOKUP() - AppSheet Help

 

Top Labels in this Space