I have a list of 35 email addresses and roles...

I have a list of 35 email addresses and roles that look like this:

john.doe@gmail.com, Chairman jane.doe@gmail.com, Vice Char james.johnson@, Clerk โ€ฆetcโ€ฆ

Each role type (Chairman, Vice Chair, Clerk) needs to have edit access to a different table in my app (Bills, Committees, Calendar).

I need to reference this table of email addresses and roles in the โ€œAre updates allowedโ€ formula in the data table, like this:

SWITCH(USEREMAIL(),

[list of email addresses corresponding to the โ€œChairmanโ€ role], โ€œUPDATES_ONLYโ€, โ€œREAD_ONLYโ€)

What is the exact expression I need to enter to grant all the people in the โ€œChairmanโ€ role edit access to this table?

Thank you very much,

Daniel

0 6 509
6 REPLIES 6

Assuming the table containing the list of emails and roles is UserTable, and emails and roles are in the [email] and [role] columns, respectively, and that there is only one row (and thus only one role) per email:

switch(lookup(useremail(), UserTable, email, role), โ€œChairmanโ€, โ€œUPDATES_ONLYโ€, โ€œREAD_ONLYโ€)

The appsheet angels have visited me!

After waiting for about 10 minutes - it began working. Thanks +Steve Coile!

Any idea how I can add MULTIPLE roles to have the same edit access?

For example, I also want โ€œVice Chairmanโ€ to also be able to edit.

Is that possible?

Thanks again!

Another question: How do I give everyone in the table, regardless of role, edit access?

@Daniel_Street You can do that with switch():

switch(lookup(useremail(), UserTable, email, role), โ€œChairmanโ€, โ€œUPDATES_ONLYโ€, โ€œVice Chairmanโ€, โ€œUPDATES_ONLYโ€, โ€œREAD_ONLYโ€)

The first argument to switch() is the value you want to test. The first argument is followed by 1 or more pairs of arguments. Each pair consists of a match value (against which the first argument of the switch() is compared), and a corresponding result value (the value returned by switch() if the match value matches). The final argument to switch() is the default result value, the value if no matches occur.

@Daniel_Street You want to give everyone in the list edit access. Are there users of the app that have access to the app but arenโ€™t on the list?

To give only users on the list edit access (โ€œUPDATES_ONLYโ€) while limiting all other users to read-only, you should replace the switch() expression with an if() expression:

if(in(useremail(), UserTable[email]), โ€œUPDATES_ONLYโ€, โ€œREAD_ONLYโ€)

+Steve Coile Sir, you are a gentleman and a scholar. Thank you.

Top Labels in this Space