[英]Google Apps Script add-ons: Installable trigger limitations
I'm looking to build an add-on that allows the user to backup data from a third-party API. 我正在寻找一个允许用户从第三方API备份数据的加载项。
The idea is that the user submits a sidebar form with some parameters required for the API, then the add-on creates a time-driven trigger that retrieves the data and outputs it to a user-specified spreadsheet. 其想法是,用户提交带有API所需的一些参数的侧边栏表单,然后该附加组件创建一个时间驱动的触发器,该触发器检索数据并将其输出到用户指定的电子表格。
The developer docs mention "Each add-on can only have one trigger of each type, per user, per document.". 开发人员文档提到“每个用户每个文档每个附件只能有一个触发器。” I'm curious to know if a user can add multiple "backup" triggers via the same add-on, as long as each trigger outputs data to a unique spreadsheet. 我很想知道用户是否可以通过相同的插件添加多个“备份”触发器,只要每个触发器将数据输出到唯一的电子表格即可。
For example, the user installs the add-on in Spreadsheet A. He/She creates a backup trigger which outputs data in Spreadsheet B, then creates another backup trigger (such as one with different parameters) which outputs data in Spreadsheet C. Spreadsheet B and C do not have the add-on installed. 例如,用户在电子表格A中安装了插件。他/她创建了一个备份触发器,该触发器在电子表格B中输出数据,然后创建了另一个备份触发器(例如具有不同参数的一个触发器),在电子表格C中输出数据。和C没有安装附加组件。
Is the scenario in the example possible? 示例中的方案是否可能? Or does the user need to install the add-on for each spreadsheet in order to have multiple backup triggers active? 还是用户需要为每个电子表格安装插件才能激活多个备份触发器?
Thanks! 谢谢!
If I understand this right, these are 3 different spreadsheets and not 3 different sheets within the same one. 如果我理解这项权利,那么这些是3个不同的电子表格,而不是同一张中的3个不同的工作表。 Also, since you mentioned that the data being backed up from B to C has different parameters than the data being passed from A to B, you will need to install the trigger on both A and B. And since no data is being passed on from C, you don't require the add-on for a backup trigger there. 另外,由于您提到从B备份到C的数据与从A传递到B的数据具有不同的参数,因此您将需要在A和B上都安装触发器。并且由于没有数据从A传递到B C,您不需要那里的触发器触发插件。 Reason being that a trigger installed on A will not be able to access data on B, filter it according to a different set of parameters and pass it on to C. Hence, B will require to have the add-on to set-up a separate trigger altogether. 原因是安装在A上的触发器将无法访问B上的数据,无法根据一组不同的参数对其进行过滤,然后将其传递给C。因此,B将需要具有附加组件才能设置a完全分开触发。 Hope this helps! 希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.