What are Apps Script triggers in Google Sheets?

Triggers tell Apps Script when to run a function: on edit, on open, on a schedule, or when a form is submitted. Simple triggers use reserved names like onEdit. Installable triggers are created in the Apps Script Triggers page and can do more, including running as a specific user or on a timer.

When to use it

Use triggers when work should happen automatically without someone opening a menu: nightly backups, reminder emails, syncing rows, or validating data the moment it is entered.

When to skip it

Avoid triggers for one-off tasks you could run manually, or when a built-in feature like conditional formatting or data validation is enough. Too many overlapping triggers make debugging hard.

How it works

  1. 1

    {:"Decide the event"=>"edit, open, clock (time-driven), or form submit."}

  2. 2

    Write a handler function with a clear name, for example sendWeeklyReport.

  3. 3

    For simple events, use reserved names onEdit or onOpen in the script file.

  4. 4

    For installable triggers, open Triggers > Add trigger and pick the function, event source, and type.

  5. 5

    Authorize the script the first time it needs Gmail, external URLs, or other restricted services.

  6. 6

    Monitor Executions and set notifications for failures on production spreadsheets.

Examples in Google Sheets

Daily digest at 8 a.m.

A time-driven trigger runs every day, reads new rows from a Responses sheet, and emails a summary with MailApp.sendEmail.

Welcome row on form submit

A form-submit trigger fires when Google Forms adds a row, then copies key fields to a CRM tab and assigns an owner from a lookup table.

onOpen custom menu

onOpen adds a Better Sheets menu with items that call your functions, giving non-technical users one-click tools.

Build this without starting from a blank cell

Use a Better Sheets tool for Apps Script triggers, then watch a walkthrough when you want the full pattern.

Better Sheets resources

Common mistakes

  • Creating duplicate time-driven triggers every time you edit the script, so the same job runs twice.
  • Expecting simple onOpen to call UrlFetchApp without an installable trigger and authorization.
  • Using a 1-minute trigger for work that only needs to run once per day, wasting quota.
  • Not checking e.range when multiple editors use the sheet, causing race conditions on busy tabs.
  • Leaving test triggers enabled in a shared production file after debugging.

Frequently asked questions

What is a simple trigger?
A simple trigger is a function with a reserved name like onEdit, onOpen, or onInstall that runs automatically with limited permissions and no Triggers UI entry.
What is an installable trigger?
An installable trigger is configured in Apps Script > Triggers. You choose the function, event, and optional failure notifications. It can access more services after authorization.
How do I delete a trigger?
Open the Triggers page in Apps Script, find the row, and click the three-dot menu > Delete trigger.
Can triggers run if the sheet is closed?
Time-driven and some installable triggers can run without the spreadsheet open. Simple onEdit and onOpen only run when a user interacts with the file.
Who pays for trigger execution time?
Execution counts against the Google account that owns the trigger or authorized the script, subject to Apps Script quotas documented by Google.
Can one function have multiple triggers?
Yes, but it is clearer to use separate functions per event so logs and failures are easier to trace.
Do triggers work on copies of a sheet?
Triggers are tied to the script project inside that spreadsheet file. A copy gets its own script container; triggers do not copy automatically in all cases, so verify after duplicating.
How do I test a time-driven trigger?
Run the handler manually once from the editor, then add a short interval trigger for testing and switch to production timing when you are confident.

Related Tutorials

Watch how Apps Script triggers works

Browse more tutorials
What Can You Automate in Google Sheets? Every single trigger available to Google Sheet users

What Can You Automate in Google Sheets? Every single trigger available to Google Sheet users

Learn about triggers, hourly, daily, weekly, etc.
Now Do It Every Damn Day - Learn to Code in Google Sheets Part 5

Now Do It Every Damn Day - Learn to Code in Google Sheets Part 5

Now that we have a script that we wanna run every day, how do we run thi...
Automatic Weekly Backup of Google Sheets

Automatic Weekly Backup of Google Sheets

Discover how to Save Your Sheets Every Week Automatically
Automate Google Sheets With Zero Experience

Automate Google Sheets With Zero Experience

By the end of this video you should be knowledgeable about how to automa...
Send a Button from Google Sheets in an Email

Send a Button from Google Sheets in an Email

quick fun video to show you how to add a button to emails when you send ...
Two Things to Know When Starting to Learn Google Sheets

Two Things to Know When Starting to Learn Google Sheets

Two things I would teach every beginner to immediately improve your skil...

Related blog posts

Guides that explain Apps Script triggers in more depth.

Browse the blog

Related glossary terms

Done reading about Apps Script triggers?

Membership unlocks 636+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.