简体   繁体   English

如何使用 G-Suite 开发人员中心创建带有“来自电子表格”事件源的独立 onEdit(e) 触发器?

[英]How can I create a stand-alone onEdit(e) trigger with a 'from Spreadsheet' event source using G-Suite Developer Hub?

I am trying to create an onEdit(e) trigger through Google App Script, however, when going to Edit -> Current Project Triggers -> Add Trigger -> "Event Source" I DO NOT get the option to select "From Spreadsheet".我正在尝试通过 Google App Script 创建一个 onEdit(e) 触发器,但是,当转到 Edit -> Current Project Triggers -> Add Trigger ->“Event Source”时,我没有选择“From Spreadsheet”的选项。

I simply like for this function to execute when there is an edit made to a cell on Google Sheets.我只是喜欢在对 Google 表格上的单元格进行编辑时执行此功能。

I have already tried creating an Installable Trigger (myOwnEditTrigger) through the G-Suite Developer Hub, however, I am forced to select "From Calendar" or "Time-Driven" event source, neither of the two are helpful for my project.我已经尝试通过 G-Suite 开发人员中心创建可安装触发器 (myOwnEditTrigger),但是,我被迫选择“来自日历”或“时间驱动”事件源,这两者都对我的项目没有帮助。

I am also trying to avoid programming the trigger through (.gs) code.我还试图避免通过 (.gs) 代码对触发器进行编程。 If that is my only option, then where can I find the contents of this code?如果这是我唯一的选择,那么我在哪里可以找到此代码的内容?

I am expecting the the return value of parameter 'e' from onEdit(e) to return a Spreadsheet containing the edited data as described under "edit" on this page https://developers.google.com/apps-script/guides/triggers/events我期待来自 onEdit(e) 的参数“e”的返回值返回一个包含编辑数据的电子表格,如本页https://developers.google.com/apps-script/guides/触发器/事件

From a Spreadsheet, go to tools > script editor从电子表格中,转到工具 > 脚本编辑器

and then write a script like然后写一个脚本

onEdit(e){
Logger.log(e);

}

从 Google Developer Hub ( https://script.google.com ),我们只能将电子表格触发器添加到绑定到电子表格项目/电子表格包含的项目。

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

相关问题 如何创建 g-suite 插件或与他人共享我编写的 Appscripts? - How can I create g-suite add-ons or share Appscripts that I've written with others? 是否可以更改文件夹的权限并使用Apps Script(G-Suite)以编程方式移动它? - Can I change permission of a folder and move it programmatically using Apps Script (G-Suite)? 从Enterprise G-Suite中的电子邮件地址获取名字和姓氏 - get first and last name from e-mail address in Enterprise G-Suite G Suite开发人员中心执行清单? - G Suite Developer Hub execution list? 事件保存/更新时的 g-suite Google 日历应用程序脚本 - g-suite Google Calender Apps script On Event Save/Update 对从另一个电子表格上传的数据使用onEdit触发器 - Using onEdit trigger on data that is uploaded from another spreadsheet onEdit() 触发器无法创建新的电子表格 - onEdit() trigger is unable to create a new Spreadsheet 如何使用onEdit事件返回已编辑单元格的范围? - How can I return the range of an edited cell using an onEdit event? G-Suite 用户访问 G-Suite 可信应用脚本时,如何避免脚本授权提示? - How to avoid script authorization prompt when G-Suite user is accessing G-Suite trusted app script? 以编程方式为独立的Webapp添加可安装的时间驱动触发器 - Programmatically adding installable time-driven trigger for stand-alone webapp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM