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โ)
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)
)
User | Count |
---|---|
19 | |
10 | |
7 | |
5 | |
5 |