Hello!
I am trying to make it so that some employees can edits a form/table, while others can only view it.
I am in the Data>Table view.
I have this expression, but donโt know if it would work.
SWITCH(USEREMAIL(),
โevelubarsky@gmail.comโ, โUPDATES_ONLYโ,
โevelubarsky@gmail.comโ, โALL_CHANGESโ,
โREAD_ONLYโ)
I want to enable multiple people to be able to edit this table. Thus far I only have my email. How do I add multiple people and is this even the correct expression?
Many thanks!
Miranda
You better have a table only for the users first.
In each row, you add the user email and create a column with a category for the user.
Example: Administrator, User, Manager, something like this.
Then you create the rules in the Data>Table view as if it was IF conditions or SWITCH conditions.
For example, bellow i will write the idea not the complete code:
SWITCH( [UserCategory],
โAdministratorโ,โALL_CHANGESโ,
โUserโ,โREAD_ONLYโ,
โManagerโ,โUPDATES_ONLYโ,
โREAD_ONLYโ
)
Ok, thanks. Still struggling with the expression though.
My column name is [Oversite]. I want the people labelled as โEvaluatorโ to be able to edit.
I want people with nothing in that column to be able to Read only.
The table name is โEmployeeโ, where that information is stored. Itโs a ref to another table.
How do I get it to look for that info there. The key in that table is Employee name, but we use the useremail to recognize the userโฆis this my problem?
Try reading this topic see you can figure out, otherwise post again, i try helping you.
The expression would look like this:
IFS(
IN(
USEREMAIL(),
LIST(
email-of-updater1,
email-of-updater2,
...,
email-of-updaterN
)
),
"UPDATES_ONLY",
IN(
USEREMAIL(),
LIST(
email-of-admin1,
email-of-admin2,
...,
email-of-adminN
)
),
"ALL_CHANGES",
TRUE,
"READ_ONLY"
)
Ok, so I tried what both Thiago and Steve recommended but still not working, Iโm probably doing something wrong.
Including lots of screen shots. First I tried Thiogoโs rec.
Donโt know why it canโt find column Evaluator when it is clearly there, and spelled the correct way in both places.
Then I tried Steveโs wayโฆ
But I feel like Iโm doing something wrong with that.
I have a Column called [Oversite] in the Employees spreadsheet which qualifies people who I want to be able to edit the view as โEvaluatorโ. I would prefer to use an expression that just uses this function so in the future if the people change, I donโt have to manually change their emails in the expression.
Cheers!
Miranda
Thank you for your help!
should be (email addresses obscured for privacy):
IFS(
IN(
USEREMAIL(),
LIST(
"f***@gmail.com",
"a***@gmail.com",
"m***@gmail.com",
"e***@gmail.com"
)
),
"ALL_CHANGES",
TRUE,
"READ_ONLY"
)
I think Steveโs idea is really good in case you wanna type the emails in the formula.
If you wanna have a column that controls the access, and you do, better use SWITCH + LOOKUP.
In the table where you type the formula for โAre updates allowed?โ, the result must be one of the values from the ENUM options (ADDS_ONLY, READ_ONLY, UPDATESโฆ etc), otherwise it wonโt work.
ANY(SELECT(Employees[Oversite],[Evaluator])=[_THISROW])
will not result in one of the ENUMs, it will result in one of the row values from column Oversite.
LOOKUP([_THISROW],โEmployeesโ,โOversiteโ,โEvaluatorโ)
i really donโt know why it doesnโt find column Evaluator, but i can say it wonโt work for the purpose , because the result value must be one of the ENUMs and this will result in a Evaluator.
soโฆ what you need to do is to try the idea from @11179 , supposing your table column Evaluator will contains the mail of people, and column Oversite which can be the access type like (Aministrator, User, Manager) or could be also a X, whateverโฆ
SWITCH(LOOKUP(USEREMAIL(),โEmployeesโ,โEvaluatorโ,โOversiteโ)),
โAdministratorโ,โALL_CHANGESโ,
โUserโ,โREAD_ONLYโ,
โManagerโ,โUPDATES_ONLYโ,
โREAD_ONLYโ)
the result being evaluated by the SWITCH is the resultant from the LOOKUP which will be โOversiteโ.
that should definetly work.
Ok, Thiago is right, I want something not dependent on email addresses.
This is what I came up with:
SWITCH((LOOKUP(USEREMAIL(),โEmployeesโ,โUseremailโ,โEmployee Nameโ)),
โEvaluatorโ,โALL_CHANGESโ,
โโ,โREAD_ONLYโ,
โAdminโ,โUPDATES_ONLYโ,
โREAD_ONLYโ)
And it checked out on the formula helper. I changed some things around from what you had Thiago but not Iโm not sure that was right.
Now, when I see the Garden Scorecard view on my phone or computer, there is no plus sign to add a new form. It was appearing before I messed around with all of this, so Iโm assuming something is wrong with the expression.
Thoughts??
And here is a screen shot of the row structure of my Employees spreadsheet. Maybe that will be helpful for you.
Is it the Oversite column that has the access level? what could be the values for Oversite?
Hej,
In your LOOKUP formula , you are returning the Employee Name, you need to return โOversiteโ column.
Under SWITCH, you have โโ,โREAD_ONLYโ, this is useless, cause in the end there is a โREAD_ONLYโ if none of the values are choosen.
Could you please put a screenshot from you table filled with 2 or 3 rows of information?
Maybe this can help to solve your issue.
The formula is now working that is why the add button disappeared, but the parameters might need to be adjusted in the formula.
Try this.
SWITCH(LOOKUP(USEREMAIL(), Employee, here put the email column, Oversite),
โEvaluatorโ , โALL_CHANGESโ,
โREAD_ONLYโ)
User | Count |
---|---|
19 | |
10 | |
7 | |
5 | |
5 |