Table Expression for Adds, Updates and Deletes - SWITCH

Hi, I am trying to work out a formula so that certain users have specific read/write access to a certain table e.g. “READ_ONLY”, “UPDATES_ONLY” etc.

Basically the users are kept in two tables (separate to the table I am setting this rule up for), I tried different variations of the SWITCH formula to get it to work as well as IF and CONTAINS but couldn’t get it to work.

Basically any user contained in Table 1 should be able to “UPDATES_ONLY”, while users contained in Table 2 will be able to “ALL_CHANGES”, all other users are “READ_ONLY”.

SWITCH(USEREMAIL(),
“Users From Table 1”, “UPDATES_ONLY”,
“Users From Table 2”, “ALL_CHANGES”,
“READ_ONLY”)

Any help would be much appreciated, thanks!

1 5 1,305
5 REPLIES 5

Steve
Platinum 4
Platinum 4

Try:

IFS(
  IN(USEREMAIL(), Table 1[Email]),
    "UPDATES_ONLY",
  IN(USEREMAIL(), Table 2[Email]),
    "ALL_CHANGES",
  TRUE,
    "READ_ONLY"
)

With appropriate substitutions for Table 1[Email] and Table 2[Email].

See also:





@Steve,

What if you want a user to have updates and Adds, but not deletes,
and another to have just read only?

Edit

Answer: “ADDS_AND_UPDATES”

For future readers, the available options are displayed within Expression Assistant when you go to edit the Are updates allowed? expression for the table:

2X_f_f726676397f6f9c4cfbb359a249fa11993d45e0f.png

2X_0_0ae3914f25e671a5eec400ee59927451d80a0a13.png

Is ADDS_AND_UPDATES one of the options?

Thanks Steve, that seems to have done the trick!

Much appreciated

James

Top Labels in this Space