Google Apps Script

Google Apps Script Trigger Troubleshooting: A Practical Step‑by‑Step Guide

Learn how to diagnose and fix non‑working Apps Script triggers by checking ownership, permissions, deployment settings, and execution logs. Includes a real‑world example and a ready checklist.

If a Google Apps Script trigger stops running, the most common reasons are wrong ownership, missing permissions, or a deployment that wasn’t saved correctly. The quickest way to get your automation back on track is to verify these three pillars, then inspect the execution logs for error details.

1. Know Your Trigger Types and Who Owns the Script

Apps Script offers two main families of triggers:

  • Simple triggers – onOpen, onEdit, onInstall. They run under the account of the user who opened the spreadsheet and cannot call services that require authorization.
  • Installable triggers – time‑driven, form‑submit, or custom triggers created via the UI or ScriptApp.newTrigger(). These run with the authority of the user who created them.

Ownership matters because only the script owner (or a user with edit access who explicitly created an installable trigger) can edit or delete a trigger. If you copied a spreadsheet to a new Drive folder, the script file may have changed owners, breaking existing triggers.

2. Step‑by‑Step Troubleshooting Checklist

  1. Confirm script ownership. Open the script editor (Extensions → Apps Script) and check the Project Owner label at the top right. If the owner is not you, request edit access or transfer ownership.
  2. Verify trigger existence. In the script editor, click the clock icon (Triggers). Ensure the expected trigger appears with the correct event type and schedule.
  3. Check authorization scopes. Installable triggers need the scopes that the script uses. Open appsscript.json (View → Show manifest file) and look for entries like "https://www.googleapis.com/auth/spreadsheets". If you added a new service (e.g., Gmail) after the trigger was created, re‑run the function manually to prompt a new authorization flow.
  4. Review deployment settings. If you published the script as a web app, make sure the deployment version matches the latest code. Click Deploy → Manage deployments**, select the active version, and hit **‘Update’** if needed.
  5. Inspect execution logs. Open View → Executions**. Filter by the trigger’s name and look for error messages. Common errors include Exception: You do not have permission to call … or ReferenceError: … is not defined.
  6. Test the trigger manually. For time‑driven triggers, select the function in the editor and click **Run**. For form‑submit or edit triggers, make a dummy edit or submit a test form. If the function runs without error, the trigger logic is sound.
  7. Re‑create the trigger. Sometimes a trigger becomes corrupted. Delete the problematic trigger and create a fresh one with the same schedule.
  8. Check quota limits. Apps Script imposes daily quotas (e.g., 90 minutes of total execution time). If you hit a quota, the trigger will stop silently. The official quota page lists limits.

3. Realistic Example: Daily Sales Report Automation

Imagine you run a small e‑commerce store on Shopify and export daily sales data to a Google Sheet named “Daily Sales”. A time‑driven trigger should run every night at 02:00 AM, pull the latest CSV from a public URL, and append the rows to the sheet.

Script snippet (simplified)

function importDailySales() { const url = 'https://example.com/sales.csv'; const response = UrlFetchApp.fetch(url); const csv = Utilities.parseCsv(response.getContentText()); const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sales'); sheet.getRange(sheet.getLastRow() + 1, 1, csv.length, csv[0].length).setValues(csv); }

After publishing the script, you create a trigger:

ScriptApp.newTrigger('importDailySales') .timeBased() .atHour(2) .everyDays(1) .create();

Six weeks later the trigger stops adding rows. Applying the checklist:

  • Owner: The original developer left the company, and the script now belongs to a service account without edit rights. Transfer ownership back to the current admin.
  • Authorization: A recent change added DriveApp to move the CSV to a backup folder, but the script never re‑authorized. Running importDailySales manually triggers the new consent screen.
  • Quota: The daily execution time limit was reached because another script started processing large image files. Moving the image‑processing job to a separate project frees quota for the sales import.

After fixing ownership, re‑authorizing, and adjusting quotas, the nightly import works again.

4. Common Mistakes and Quick Fixes

  • Assuming a simple trigger can call external services. Fix: Switch to an installable trigger or add the required scopes.
  • Copying a spreadsheet without also copying the bound script. Fix: Use File → Make a copy** in the script editor to duplicate both.
  • Forgetting to re‑authorize after adding a new API. Fix: Run any function manually to surface the consent dialog.
  • Leaving a trigger pointing to a deleted function. Fix: Delete the orphaned trigger from the Triggers page.
  • Exceeding daily quotas without monitoring. Fix: Add Utilities.sleep() between heavy calls or split work across multiple scripts.

5. Quick Troubleshooting Checklist

  • Is the script owned by the account that created the trigger?
  • Does the trigger appear in the Triggers dashboard?
  • Have all required scopes been authorized?
  • Is the latest code version deployed (if using a web app)?
  • Do the execution logs show any errors?
  • Can you run the function manually without error?
  • Have you recreated the trigger after a major edit?
  • Are you within Apps Script daily quotas?

6. Next Steps and When to Call for Help

Most trigger problems are resolved by following the checklist above. If you still see silent failures after confirming ownership, permissions, and quotas, consider these options:

  • Share the script with a colleague who has full edit access and let them run the function to isolate account‑specific issues.
  • Export the script (File → Download → . gs) and test it in a fresh Google Sheet to rule out sheet‑level conflicts.
  • Reach out to a developer familiar with Apps Script, especially if you need to refactor code for better error handling.

Remember, Google’s official documentation is the most reliable source for limits, permission scopes, and trigger behavior. Visit the Apps Script developer site for up‑to‑date details.

7. Helpful Resources

Conclusion

When a Google Apps Script trigger stops working, start by confirming who owns the script, whether the correct permissions are granted, and what the execution logs reveal. A systematic checklist saves time and prevents the need for costly developer hours. With the steps above, most small‑business owners can restore their automation quickly and keep their Shopify or Amazon workflows running smoothly.