Hero Bg Gradient
February 17th, 2025

How to Set Up Your First Google Apps Script Trigger in Google Sheets

Blog Details Image

Automate tasks in Google Sheets in minutes. Learn how to create your first Apps Script trigger without advanced coding.

Client Image

Patrick Flanagan

February 17th, 2025

Tired of updating Google Sheets manually? With Google Apps Script, you can automate repetitive tasks and save hours each week. One of the easiest ways to start is by setting up a trigger—a small piece of code that runs automatically based on a specific event. Below, you’ll learn how to create your first trigger in just a few quick steps.

Step 1: Open the Script Editor

  1. In your Google Sheet, click on Extensions in the menu bar.
  2. Select Apps Script from the dropdown.
  3. A new tab will open, taking you to the Google Apps Script Editor.

Tip: If you don’t see “Apps Script” under Extensions, make sure you’re using a personal or Workspace account that has access.

Step 2: Write a Simple Function

  1. In the Script Editor, delete any placeholder code.
  2. Paste the following example function:
function sendHelloEmail() {
  // Replace this with your email address
  var recipient = "youremail@example.com";  
  var subject = "Hello from Apps Script!";
  var body = "This email is sent automatically whenever a change is detected in your Google Sheet.";
  
  GmailApp.sendEmail(recipient, subject, body);
}
  1. Click the Save icon or press Ctrl + S (Windows) / Cmd + S (Mac).

Explanation: This function sends a simple “Hello” email. We’ll connect it to a trigger so it fires automatically.

Step 3: Create the Trigger

  1. In the Script Editor, click the Triggers icon on the left sidebar (it looks like a clock).
  2. Choose Add Trigger at the bottom right.
  3. Under Choose which function to run, select sendHelloEmail.
  4. Under Select event source, pick From spreadsheet.
  5. Choose an event type such as On change (runs whenever a change is made to your spreadsheet).
  6. Click Save and authorize the script if prompted.

Note: There are various trigger types (e.g., “On edit,” “Time-driven,” etc.). Select the one that suits your needs best.

Step 4: Test Your Trigger

  1. Return to your Google Sheet and make a small edit (like typing in a cell).
  2. Wait a few seconds—Apps Script will detect the change and run the function.
  3. Check your email inbox for the automated message.

Conclusion

By setting up a Google Apps Script trigger, you’ve taken your first step into the world of automating tasks in Google Sheets. Whether you want to send email notifications, format data automatically, or integrate with external services, triggers can help you work smarter—and free up your time for more important tasks.

Need more advanced automations? Contact us for custom solutions tailored to your business.

Ready to Transform Your Business?