Stay organized with collections Save and categorize content based on your preferences.
Apps Script triggers cause a specified script function (the trigger function) to execute whenever a specified event occurs. Only certain events can cause triggers to fire, and each Google Workspace application supports a different set of events.
When a trigger fires, an event object is created. This JSON structure contains details about the event that occurred. The information in the event object structure is organized differently based on the trigger type.
Once the event object is created, Apps Script passes it as a parameter to the trigger function. The trigger function is a callback function that you must implement yourself, to take whatever actions are appropriate to respond to the event. For example, in a Google Workspace add-on that extends Gmail, you can define a trigger that creates a new card interface when the user opens a message thread. In this case, you implement a contextual callback function to create the cards making up the new UI using the data passed in the event object.
This page provides guidelines on using triggers in Google Workspace add-on projects.
Manifest triggersUnlike Editor add-ons, Google Workspace add-ons currently can't use Apps Script simple triggers Instead, they use triggers designed specifically for Google Workspace add-ons: manifest triggers.
Manifest triggers are defined completely in the Google Workspace add-on's manifest. Examples of manifest triggers include the following:
drive.file
OAuth scope in the current Editor document.In the above list, only homepage triggers are non-contextual; the rest are contextual triggers. See Manifest for more information about manifest trigger definitions.
In addition to manifest triggers, Google Workspace add-ons can also use Apps Script installable triggers.
RestrictionsManifest triggers have certain restrictions to their use.
Script
service to create or modify these triggers.unconditional
criteria. This means contextual triggers fire for every email message, regardless of content.Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-06 UTC."],[[["Apps Script triggers execute a specific function when a defined event occurs within a Google Workspace application."],["Google Workspace add-ons utilize manifest triggers, defined in the add-on's manifest, to respond to events like opening a document or composing an email."],["Manifest triggers can be contextual, reacting to specific user actions within a document or application, or non-contextual, like those that build the add-on's homepage."],["While manifest triggers offer event-driven functionality, they have limitations, including restrictions on their use and creation methods."]]],["Apps Script triggers initiate a script function when specific events occur, creating an event object with event details. This object is then passed to a user-implemented trigger function, enabling actions based on the event. Google Workspace add-ons use manifest triggers, defined in the add-on's manifest, to trigger actions like displaying cards on homepage, when opening/updating Calendar events, selecting Drive items, or opening a message in Gmail. Contextual triggers and installable triggers are also supported but with some restrictions.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4