← All posts

Apps Script · Automation

The Beginner's Guide to Google Apps Script for Automating Recurring Reports

Marianne Gatlabayan explains Google Apps Script from zero. Automate Sheets, send emails, run schedules. Free tool, copy-paste code, clear steps. Start today.

Marianne Gatlabayan · Sep 24, 2026 · 18 min read

In short: Google Apps Script is JavaScript running on Google servers with special access to your Workspace. It costs nothing, requires no installation, and automates most recurring report tasks in Gmail, Sheets, Docs, and Calendar. Beginners get productive in a weekend and unlock a category of workflow that Zapier and Make cannot touch for free.

Key Takeaways

  • Google Workspace serves 3 billion users worldwide with 11 million paying customers
  • Apps Script is included with every Google account at no extra cost
  • Time-driven triggers turn any script into automation without external scheduling
  • Marianne Gatlabayan uses Apps Script to run daily PR pitch tracking, weekly reports, and lead intake
  • The 6-minute execution limit is the main constraint; batching gets around it

Hub-and-spoke diagram with Apps Script at the center connecting to Gmail (send), Sheets (update), Docs (draft), Drive (save), Calendar (schedule), Forms (collect), Slack (notify), and any REST API (fetch)

Why Apps Script is the best free tool you are not using

Google Sheets serves 900 million monthly active users. Gmail serves 1.5 billion. Google Workspace supports over 3 billion users worldwide with 11 million paying customers. Every one of those accounts has Apps Script sitting inside, waiting for someone to give it a job.

Apps Script sits inside every one of those accounts and lets you automate anything the Google ecosystem touches. It is free. It runs on Google's servers. It requires no installation, no server setup, and no credit card. Zapier charges $30 per month for what a 20-line Apps Script does for free.

Yet most people who use Google Workspace daily have never touched it. Marianne Gatlabayan wrote this guide to change that. The learning curve is a weekend for someone with any coding background and slightly longer for a total beginner, but the payback is a lifetime of free automation across Gmail, Sheets, Calendar, Drive, and any REST API.

What is Google Apps Script exactly?

JavaScript that runs on Google servers, with special access to your Google Workspace. That is the whole thing. Not a proprietary language. Not a walled ecosystem. Standard JavaScript with a set of built-in objects like GmailApp, SpreadsheetApp, and CalendarApp that give the script permission to read and write your Google data.

If you know a little JavaScript, you can write Apps Script from day one. Variable declarations, functions, loops, and arrays all work the same as any other JavaScript environment. The unique parts are the built-in services and the specific quotas Google enforces.

If you know none, the syntax is close enough to plain English that beginners get productive within a weekend. Simple scripts like "send myself an email" or "log today's date to a Sheet" are three or four lines of code that read almost like English sentences. The learning is less about JavaScript and more about which built-in method to call for the task at hand.

How do you open the Apps Script editor?

Two ways in. Pick whichever fits the moment.

From any Google Sheet, click Extensions, then Apps Script. This opens the editor in a new tab, with the script "bound" to the current Sheet. Bound scripts automatically have access to the Sheet without needing to specify its ID, which makes them faster to write for Sheet-specific automation.

From script.google.com directly. This creates a "standalone" script that is not attached to any specific document. Standalone scripts are better for workflows that touch multiple Sheets or that need to be shared across an organization without dragging a source Sheet along.

Either method opens a code editor with a blank function ready.

function myFunction() {

}

That is your starting point. Every script you write sits inside a function like this. You can have multiple functions in one script file. Each function can be run independently by clicking Run at the top of the editor.

How do you write your first Apps Script that sends an email?

Paste this in and hit Save. This is the smallest useful script you can write.

function sendMyself() {
  GmailApp.sendEmail(
    'your.email@example.com',
    'Hello from Apps Script',
    'This email came from a script that took 30 seconds to write.'
  );
}

Click Run. Google will prompt for permissions the first time (which is a normal part of the OAuth flow). Grant every permission the script requests.

Check your inbox. The email is there, sent from your Google account address as if you had composed it manually.

That single script proves you have automation power. Every other tutorial in this post builds on the same three-line pattern: pick a service, call one of its methods, done. GmailApp.sendEmail is one of dozens of methods on the Gmail service. Every service (SpreadsheetApp, CalendarApp, DriveApp, DocumentApp) has a similar set of methods for the tasks you would do manually.

How do you read data from a Google Sheet with Apps Script?

The pattern to read a value is three lines.

function readFromSheet() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const value = sheet.getRange('A1').getValue();
  Logger.log(value);
}

Logger.log() writes to the Executions log panel at the bottom of the editor. Use it while learning because it replaces console.log from browser JavaScript. When the script runs, the log shows what value came out of cell A1.

To read a whole range at once:

const data = sheet.getRange('A1:D10').getValues();

getValues returns a two-dimensional array. data[0][0] is A1. data[1][0] is A2. data[0][1] is B1. Working with the whole array in memory is faster than calling getValue cell by cell in a loop, which is the most common performance mistake beginners make.

How do you write data to a Google Sheet with Apps Script?

The mirror pattern for writing:

function writeToSheet() {
  const sheet = SpreadsheetApp.getActiveSheet();
  sheet.getRange('A1').setValue('Automated');
  sheet.getRange('A2').setValue(new Date());
}

setValue overwrites whatever is in the cell. To write a whole array back at once, use setValues (plural) against a range of matching dimensions.

Or append a whole row to the bottom of the Sheet:

sheet.appendRow(['Column A', 'Column B', 'Column C']);

appendRow is the workhorse. Nine times out of ten, you use it to log new data at the bottom of a sheet. For scheduled scripts that add one new row per run (like a daily metric snapshot), appendRow is the exact right method. It handles finding the next empty row automatically.

What are Apps Script triggers and how do they enable automation?

A script that only runs when you click Run is not automation. Triggers make it automation. They tell Apps Script to run a specific function on a schedule or in response to an event.

In the editor, click the clock icon on the left sidebar. That opens the Triggers panel. Click Add Trigger in the bottom-right corner. Pick the function to run. Pick Time-driven as the event source. Choose the schedule.

Options include every minute, every hour, every day at a specific time, every week on a specific day, or every month on a specific date.

Trigger typeWhat triggers itCommon use case
Time-drivenA schedule you setWeekly report email
onOpenOpening a SheetAdding a custom menu
onEditEditing a Sheet cellLogging when values change
onFormSubmitGoogle Form submissionCustom form processing
WebhookExternal POST requestZapier or Make triggering the script

Most reporting automation uses the time-driven trigger. The others become useful for specific workflow patterns like custom Google Forms processing or in-Sheet menu buttons.

How do you write a full weekly report script?

This one pulls data from a Sheet, formats it, and emails it every Monday. It combines everything from the earlier examples into one working automation.

function weeklyReport() {
  const SHEET_ID = 'YOUR_SHEET_ID';
  const RECIPIENT = 'client@example.com';

  const sheet = SpreadsheetApp.openById(SHEET_ID).getSheetByName('Data');
  const lastRow = sheet.getLastRow();
  const data = sheet.getRange(2, 1, lastRow - 1, 4).getValues();

  let body = 'Weekly Report\n\n';
  body += 'Date | Sessions | Conversions | Revenue\n';
  body += '---\n';

  data.slice(-7).forEach(row => {
    body += `${row[0]} | ${row[1]} | ${row[2]} | $${row[3]}\n`;
  });

  const total = data.slice(-7).reduce((sum, row) => sum + row[1], 0);
  body += `\nTotal sessions this week: ${total}`;

  GmailApp.sendEmail(RECIPIENT, 'Your Weekly Report', body);
}

The script opens a specific Sheet by ID, reads the last 7 rows of data, formats a simple email body with the values, calculates a weekly total, and sends the email. Under 20 lines of code.

Set a Monday morning trigger pointing at this function. The client gets a report without you touching anything on Monday. For HTML-formatted emails with tables and colors, replace sendEmail(to, subject, body) with sendEmail(to, subject, '', {htmlBody: 'your html here'}).

How do you handle Apps Script errors without crashing?

Real scripts fail. APIs time out. Sheets get renamed. Formulas break. Networks drop. A script that fails silently in the background is worse than one that never ran, because you assume it worked when it did not.

Wrap risky operations in a try-catch:

function safeReport() {
  try {
    weeklyReport();
  } catch (e) {
    GmailApp.sendEmail(
      'your.email@example.com',
      'Report script failed',
      `Error: ${e.message}\n\nStack: ${e.stack}`
    );
  }
}

Point the trigger at safeReport instead of weeklyReport. Now if anything breaks, you get an email with the error and the stack trace instead of silence. The email tells you which line failed and often points directly at the fix.

For longer scripts with multiple steps, wrap each step in its own try-catch and log which step failed. This turns hours of debugging into minutes because you know exactly which operation broke. Marianne Gatlabayan uses this pattern on every production Apps Script and estimates it saves 5 to 10 hours per year of debugging across her client base.

How do you use Apps Script to manage Gmail beyond sending?

Apps Script can also read Gmail. Search threads. Add labels. Reply automatically. Move messages between labels. The GmailApp service exposes almost everything the Gmail web interface can do.

function labelUrgent() {
  const threads = GmailApp.search('subject:urgent -label:handled', 0, 20);
  const label = GmailApp.getUserLabelByName('urgent') ||
                GmailApp.createLabel('urgent');
  threads.forEach(thread => thread.addLabel(label));
}

That labels every unread email with "urgent" in the subject. The search query uses standard Gmail search syntax, so any search you would type into the Gmail search box works here too. The || createLabel idiom creates the label if it does not exist yet, which prevents errors on the first run.

Combine with a scheduled trigger and you have an inbox triage bot. Run every 15 minutes. The bot labels new urgent messages, forwards VIP sender emails to Slack, auto-replies to common questions, and generally does the inbox management work you would otherwise do manually. This is one of Marianne Gatlabayan's favorite patterns because it recovers hours of inbox management per week.

What are the common beginner mistakes to avoid?

Hardcoding IDs in every script. Store the Sheet ID and other constants at the top of the file. When something changes, you edit one place instead of hunting through 20 functions. For multi-environment setups, use PropertiesService to load IDs from a config store rather than hardcoding at all.

Reading one cell at a time in a loop. Every getValue call is slow because it round-trips to Google's servers. Read the whole range once with getValues, loop over the array in memory, then write back once with setValues. This one change speeds up most scripts by 10x or more.

Forgetting the daily quotas. Free Gmail accounts allow 100 emails per day via Apps Script. Workspace accounts allow 1,500. If you send more than that, batch or move to a proper mail service. The quotas reset at midnight Pacific time, so a burst of overnight emails might work while an evening batch fails.

Ignoring execution time limits. Simple triggers must complete in 30 seconds. Time-driven triggers get 6 minutes on free accounts, 30 minutes on Workspace. Long jobs need to be chunked into smaller runs and coordinated with PropertiesService to track progress, or moved to Cloud Functions where the limits are more generous.

Where should you go next after mastering the basics?

Once you have the basics down, the highest-value patterns to learn next fall into three categories.

Custom menus that add buttons to your Sheets. Useful for handing scripts to non-technical teammates. The onOpen trigger creates a menu item that runs your function when clicked. Now a script that used to require opening the editor becomes a one-click operation for anyone with access to the Sheet.

Web apps that expose your script as a URL others can visit or POST to. Useful for turning a script into a mini internal tool. A web app can accept form data, process it, and return HTML or JSON responses. This is how many small internal tools get built without any real backend infrastructure.

External API calls with UrlFetchApp. Useful for pulling data from any REST API into a Sheet. This unlocks the entire external internet as a data source for your automations. Any tool with an API becomes an integration you can build in an afternoon.

Each of these unlocks a category of workflow that Apps Script alone can automate for free. The Gmail to Sheets guide and the weekly client reporting guide both showcase these patterns in production.

Which Apps Script resources actually help beginners?

The official Apps Script documentation at developers.google.com/apps-script is thorough but dense. Read it as a reference, not a tutorial. When you know what method you need, the docs tell you the exact syntax. When you are trying to learn what is possible, the docs are overwhelming.

The best free video course is on YouTube from Learn Google Sheets & Excel Spreadsheets. Full playlist covers most patterns with concrete examples. Watch this after building your first two or three scripts so the concepts have context.

For real project ideas, browse the Google Workspace Marketplace and read what other developers built. Reverse engineering existing add-ons is a fast way to see what is possible. Marianne Gatlabayan built her first three Apps Scripts by copying patterns from public marketplace add-ons and adapting them to her own workflows.

Frequently Asked Questions

Do I need to be a developer to use Apps Script?

No. Basic JavaScript familiarity helps but is not required. Copy-paste from existing scripts, run them, and modify small parts to learn the syntax. Within a weekend of tinkering, most non-developers can build a working automation.

Can I use Apps Script on my phone?

No. The Apps Script editor requires a desktop browser. Scripts that run on schedule work regardless of what device is nearby because they run on Google's servers.

Is Apps Script code stored on my computer or in Google Cloud?

In Google Cloud. Your scripts live in the Apps Script project attached to your Google account. Access them from any device by logging in at script.google.com.

Can I share Apps Script code with other people?

Yes. Bound scripts (attached to a Sheet) share with the Sheet. Standalone scripts share via the Apps Script project settings, similar to Google Docs sharing. For distributing scripts to a wider audience, publish them as add-ons through the Google Workspace Marketplace.

Will Apps Script scripts stop working if Google changes something?

Rarely. Google maintains backward compatibility on core services. Deprecations get a minimum of one year of notice via email to script owners. Marianne Gatlabayan has scripts from 2018 that still run today without modification.

What to read next


About the Author: Marianne Gatlabayan is a Systems Strategist and Industrial Engineer focused on optimizing operations, automating workflows, and driving business growth. With over a decade of experience in analytics, reporting, and process improvement, she helps organizations build scalable systems that turn complexity into measurable results. In her free time, Marianne enjoys discovering and sipping her favorite coffee bean of the week. Connect on LinkedIn.

Sources

Work with me

Have a process like this worth automating?

Tell me about the bottleneck: the report nobody wants to build, the data nobody trusts. I'll come back with a practical way to automate it.