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
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โ)
User | Count |
---|---|
38 | |
35 | |
27 | |
23 | |
18 |