How to have SWITCH with Multiple Expected Values for the Same Expect Result?

Dear Colleagues,

I would like to know how to have SWITCH with Multiple Expected Values for the Same Expect Result please?

I have the following expression from the Data Table Provile for “Are Updates Allowed?”:

Standard:
SWITCH(USEREMAIL(),
user1@mydomain.com”, “UPDATES_ONLY”,
user2@mydomain.com”, “ALL_CHANGES”,
“READ_ONLY”)

I want to make it like this, where the Expected Resulit of “ALL_CHANGES” has multiple email addresses:

SWITCH(USEREMAIL(),
(OR “user1@mydomain.com”, “user2@mydomain.com”), “ALL_CHANGES”,
“READ_ONLY”)

The above does not work, so what is the correct expression to allow different email addresses to have “ALL_CHANGES”?

Thanks.

Try
IF(IN(USEREMAIL(), LIST(“user1@mydomain.com”, “user2@mydomain.com”)), “ALL_CHANGES”,
“READ_ONLY”)

1 Like

Oh. So it is not essential to use the SWITCH Statement in the context of the expression from the Data Table Provile for “Are Updates Allowed?”

Correct, you can either use SWITCH or IF.

Can I obtain the email addresses from a select function or list from another table?

Yes you can.

Or IFS(). Or any expression that yields an access mode. Not a good idea, but perfectly valid:

INDEX(
  {"ADDS_ONLY", "ADDS_AND_DELETES", "UPDATES_ONLY", "READ_ONLY"},
  RANDBETWEEN(1, 4)
)

:slight_smile:

2 Likes