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.

0 6 1,243
6 REPLIES 6

Try
IF(IN(USEREMAIL(), LIST(โ€œuser1@mydomain.comโ€, โ€œuser2@mydomain.comโ€)), โ€œALL_CHANGESโ€,
โ€œREAD_ONLYโ€)

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)
)

Top Labels in this Space