Search code examples
google-apps-scripttriggersgoogle-apps-script-addon

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.

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.

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.

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!


Solution

  • If I understand this right, these are 3 different spreadsheets and not 3 different sheets within the same one. 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. 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. Hope this helps!