Skip to content Skip to sidebar Skip to footer

Google Sheets, Running A Function As Owner

Ok I'm very new at SO and and reasonably new with JS and Sheets. I am writing a sheet for work that runs over 3 shifts with a front page and 4 sheets for each shift. Each correspon

Solution 1:

I tried creating a menu item which changes a cell value. Unfortunately it won't trigger the onEdit event handler. So, I'm afraid you can do it from a menu item. A workaround would be adding validation rule to a cell to create a drop-down menu.


To those interested in the steps:

First, the workflow:

  • The spreadsheet has a cell called "Shift"
  • The user can change the value to "Start", "End", or ""
  • Set the appropriate protection when the value of "Shift" changes

Here are the steps:

  1. Create a function, say unprotect(), which checks if "Shift" is the active cell and sets the appropriate protection
  2. In your project script editor, go to Resources > Current project's triggers
  3. Create the following rule: run unprotectfrom spreadsheeton edit
  4. Since unprotect() is an installed trigger, it will run with the owner permission.

Post a Comment for "Google Sheets, Running A Function As Owner"