简体   繁体   English

如何允许onEdit函数影响Google表格中的受保护单元格?

[英]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. 我有一个具有受保护范围的工作表,因此任何具有该链接的用户都可以编辑A列,并且onEdit()函数根据其受保护的输入写入B列,因此只有我可以在登录时对其进行编辑。

This protection prevents the onEdit() from doing its thing for anonymous users so column B never has its value set. 这种保护可以防止onEdit()为匿名用户执行此操作,因此列B永远不会设置其值。

How can you override this? 你怎么能覆盖这个? I like the way excel allows this. 我喜欢excel允许的方式。

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. 因此,如果您是触发器的创建者并且您的帐户有权编辑受保护的单元格,则会更新它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使 onEdit(e) 在受保护的工作表上运行? Google Apps 脚本 - How to make onEdit(e) run on protected sheet? Google Apps Script 如何启动工作表中仅一个特定单元格的Google脚本函数onEdit? - How to fire a Google Script function onEdit of just one particular cell in a sheet? 如何在受保护的Google表格中启用功能? - How to allow function in protected Google Sheets? Google Sheets onEdit 函数跳转到 A1 单元格 - Google Sheets onEdit function jumping to A1 cell 在谷歌表格中 - 如何应用 onEdit 触发器以仅在一张表格上的一个单元格上运行? - In google sheets - how do I apply an onEdit trigger to run on just one cell on one sheet? 当某个单元格的值更改时,Google工作表onEdit - Google sheet onEdit when value of a certain cell changes 谷歌应用脚本 OnEdit 仅在一张表中的一个单元格上运行 - Google app script OnEdit to run only on one cell in one sheet 如何使用 onEdit(e) function 为 Google Spread Sheet 中的多个子表获取日期和时间 - How to get Date & Time using onEdit(e) function for multipal Sub Sheets in Google Spread Sheet 您如何使用“OnEdit”功能将谷歌表格宏设置为仅在一张纸上运行? - How do you set a google sheets macro with the "OnEdit" function to run only on one sheet? Email 未在 onEdit function google sheet 脚本中发送 - Email not being sent in an onEdit function google sheet script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM