Hello,
I would like to create the table with list of approved editors for my app, and than on the base on user email to let the user edit or just read only. My idea is to create โEditorsโ table just with โMailโ column and to use code to check if user email is on Editors table and than add proper access.
The code :
SWITCH(USEREMAIL(),
LOOKUP( โUSEREMAIL()โ , โEditorsโ , โMailโ , โMailโ ), โUPDATES_ONLYโ,
โREAD_ONLYโ)
Still not working but do you thing it is a good idea or is it better to do it other way?
Try something likeโฆ
IF(
IN(USEREMAIL(),Editors[Mail]),
โUPDATES_ONLYโ,
โREAD_ONLYโ
)
@Aleksiโs suggestion is a good one.
The reason your expression didnโt work is because you enclosed USEREMAIL()
within quotes in your LOOKUP() expression:
LOOKUP( โUSEREMAIL()โ , โEditorsโ , โMailโ , โMailโ )
As a result, LOOKUP() was looking for the literal text, USEREMAIL()
, rather than for the current userโs email. Had you instead used:
LOOKUP( USEREMAIL() , โEditorsโ , โMailโ , โMailโ )
without the quotes around USEREMAIL()
, it likely would have worked fine.
Hello another stepโฆ can I nest IFs in this expression? I tried sth like this, and it does not work:
IF: (IN(USEREMAIL(),Experts[ExpertMail]),
โALL_CHANGESโ,
IF(IN(USEREMAIL(),Editors[EditorMail]),
โADDS_ONLYโ,
โREAD_ONLYโ)
,โREAD_ONLYโ)
Try this instead:
IF(
IN(USEREMAIL(), Experts[ExpertMail]),
โALL_CHANGESโ,
IF(
IN(USEREMAIL(), Editors[EditorMail]),
โADDS_ONLYโ,
โREAD_ONLYโ
)
)
Or this:
IFS(
IN(USEREMAIL(), Experts[ExpertMail]),
โALL_CHANGESโ,
IN(USEREMAIL(), Editors[EditorMail]),
โADDS_ONLYโ,
TRUE,
โREAD_ONLYโ
)
See also:
Thanks a lot, worked perfectly as usual!
I have read above but somehow got lost in nesting - my experience in coding is close to zero
User | Count |
---|---|
40 | |
34 | |
29 | |
23 | |
17 |