简体   繁体   中英

How to allow onEdit function to affect protected cell in a Google Sheet?

I have a sheet that has protected ranges so any user with the link can edit column A, and an onEdit() function that writes to column B based on their input which is protected so only I can edit it when logged in.

This protection prevents the onEdit() from doing its thing for anonymous users so column B never has its value set.

How can you override this? I like the way excel allows this.

You can use an installable trigger running on edit. Such a trigger runs as the user who created it, regardless of whose edit caused it to run. So, if you are the creator of the trigger and your account is authorized to edit protected cells, they will be updated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM