Limiting the people that can edit a view/table

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

0 12 520
12 REPLIES 12

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.

Steve
Platinum 4
Platinum 4

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โ€)

Top Labels in this Space