Installable triggers in add-ons for Google Docs and Sheets

Earlier this year, we introduced add-ons for Google Docs and Sheets—packaged Apps Script projects that users can easily install from our add-on store to get extra functionality and features.

Since then, plenty of developers told us they were eager to add installable Apps Script triggers to their add-ons. We're happy to announce that now you can do just that, making it possible to respond to more user actions. For example, a spreadsheet add-on can now react when a user submits a response to a Google Form, or can call a method that requires authorization when a user edits a cell.

Add-ons can now programmatically create and manage these installable triggers:

  • Sheets add-ons can use the change, edit, open, and form-submit installable triggers.
  • Docs add-ons can use the (new!) open installable trigger.

To see the power of installable triggers in action, check out developer Romain Vialard's Yet Another Mail Merge, which has already been updated. The original YAMM lets users quickly personalize Gmail drafts by replacing placeholder fields with data from a spreadsheet. The new version uses a trigger to send an email whenever a form is submitted.

If you've worked with installable triggers before, you'll find that they behave a little differently in add-ons (for one thing, there are no pesky "Summary of failures" emails!), so be sure to check out the documentation.

Posted by Edward Jones, Googler