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