0

I would like to know how one should approach the problem of creating a sheet with the following requirements:

Let's say User A has access to Sheet1 and Sheet2 but not to Sheet3 (a helper sheet) which is protected and only accessible by admins. Sheet1 has two buttons linked to script functions that need to make edits to Sheet3.

  1. How should I structure my script such that User A can use the buttons in Sheet1?

  2. There is an onEdit(e) function that triggers when edits are made to Sheet1. The onEdit function also makes edits to Sheet3. How should I structure my script such that User A can trigger edits to Sheet3 when they are using Sheet1?

So far, I believe I have only found a solution to problem #1 which is to deploy the script as a web app. What would be the best way to approach problem #2?

If you have a better solution for #1 as well then please feel free to present such alternatives!

Appreciate any help I can get, thanks.

TheMaster
  • 45,448
  • 6
  • 62
  • 85
dan
  • 347
  • 2
  • 14
  • If the linked duplicate answers doesn't answer your question, [edit] your question to explain how the answers don't satisfy your question. Note that there's a proper [etiquette](https://meta.stackoverflow.com/questions/252252) to dispute a duplicate. If you're having trouble implementing a solution in the duplicate or don't understand a solution provided, ask a new specific question with the part you're having trouble with. – TheMaster Oct 13 '22 at 16:44
  • @TheMaster Sorry, I just had a read at the links provided. I think the fact that they're answers for other problems may have confused me. Is this saying that I should use a combination of installable triggers and webapp? – dan Oct 13 '22 at 17:20
  • Installable triggers OR webapp. In your case, installable triggers would be best. – TheMaster Oct 13 '22 at 18:25
  • @TheMaster Gotcha, I'll watch some videos on installable triggers then, thank you! – dan Oct 13 '22 at 20:04
  • Just read the links in my answer and official documentation. – TheMaster Oct 14 '22 at 06:12

1 Answers1

0

The best way for this is:

  1. Create the third user
  2. Add full access for the third user
  3. Rename onEdit to onedit
  4. Install onedit as a function of the EDIT trigger
contributorpw
  • 4,739
  • 5
  • 27
  • 50