Table Updates Allowed, expression assistant

Hi,

I am trying to work out an expression to allow users access to certain tables, but can work out how to achieve it.

I have a table called user access, this contains email addressโ€™ and table names.

Each user email will also have a brief description of what they are able to do in each table. i.e Read, Add, Update

The expression I want to achieve is if the useremail is within the table user access, and the column Products is add, the I want the access to be Add Only, or if that same column is Update then it should be set to Add and Update and so onโ€ฆ

Is this achievable?

Kind Regards

0 5 838
5 REPLIES 5

Steve
Platinum 4
Platinum 4

EDIT: Added missing comma.

In the tableโ€™s Are updates allowed? property, enter an expression like this:

SWITCH(
  LOOKUP(
    USEREMAIL(),
    "user access",
    "email",
    "Products"
  ),
  "Add", "ADDS_ONLY",
  "Update", "ADDS_AND_UPDATES",
  "READ_ONLY"
)

@Steve I have copied and pasted your formula but get the following error message.

โ€œSWITCH function is used incorrectly:Inputs to SWITCH() must be an initial expression, one or more value-result pairs, and a default resultโ€

One comma is missing between โ€œโ€ฆUpdatesโ€ and โ€œRead_Onlyโ€

@Aleksi I have tried that but the formula does not work, even if I have add_only in the cell it does not allow the user to add new data

Instead of writing values like โ€œAddโ€, โ€œUpdateโ€ you could write values directly like โ€œAdds_Onlyโ€ etc.

Then you could read it like LOOKUP(USEREMIL(),โ€œUser Accessโ€,โ€œEmailโ€,โ€œProductsโ€)

Top Labels in this Space