Google app
Triggers
A trigger is a saved schedule or event rule in ScriptApp that runs your function on time, on edit, or on form submit.
Choose a task using TriggersStart with an outcome
Tasks that use Triggers
Choose the result first. Each card opens a step-by-step guide.
- Triggers Run an Apps Script function every day
Make a function run on its own once a day. Run the setup function once, and from then on Apps Script calls the reminder function each day around the hour you chose.
- Triggers Add a timestamp when a row changes
When you change a status cell, the script writes the current date and time into the same row. You save the script and nothing else needs to be installed.
- Triggers Copy a row when a checkbox is checked
Check a box on a Students tab and the script adds that person to a Tracking tab. It then writes Tracked in the Students row, so checking the box again does not add a duplicate.
- Triggers Send an email when a status changes
Email the person on a row whenever the status in that row changes. One installed trigger covers every tab in the spreadsheet, including tabs you copy later.
- Triggers Respond to a Google Form submission
Get an email every time someone submits your Google Form, listing each question and its answer. The email goes only to you, the owner of the script.
- Triggers Send a confirmation to the form respondent
Send each person who submits your Google Form a short thank-you email that repeats their answers. The form must collect verified email addresses.
- Triggers Email yourself a weekly sheet summary
Get a short email every Friday with the numbers from an Orders tab: how many rows it has, the total of column C, and how many rows are not Done. Run the setup function once to install the weekly trigger.
- Triggers Back up a spreadsheet to Drive every week
Keep a dated copy of a spreadsheet in a Drive folder. Run the setup function once, and every Monday morning the script saves a new copy with the date in its name.
- Triggers Email yourself tomorrow's calendar agenda
Get an email each evening listing tomorrow's events on your main Google Calendar. Run the setup function once to install the daily trigger.
- Triggers Check a website and alert when it is down
Get one email when a website stops answering and one when it is back. An hourly trigger fetches the address, and a saved script property stops the script from emailing you every hour during one outage.
Snippets
Snippets for Triggers
Complete functions you can paste and run one at a time.
Object reference
Objects available in Triggers
Open an object when you need to get it, try a common action, or inspect exact method signatures.
- Object reference Trigger builder
ScriptApp.newTrigger(functionName) returns a TriggerBuilder that configures a timeBased(), forSpreadsheet(), or forForm() trigger before create() saves it.
- Object reference Trigger
A ScriptApp.Trigger is one installed schedule or event rule in this project. ScriptApp.getProjectTriggers() returns only the installable triggers that belong to you, the user running the script. Use it to see which function a trigger runs, or delete a trigger with ScriptApp.deleteTrigger(). Other users must delete their own triggers.
- Object reference Form response
A FormResponse contains the answers sent in one Google Form submission. A form-bound submit trigger passes it to your function as event.response, where getItemResponses() returns the submitted item responses.