Google Apps Script: Automate Sheets and Email Without a Developer

Google Apps Script: Automate Sheets and Email Without a Developer

Peter Gáborík
Published
10 min read
Artificial intelligenceAutomationGoogle Apps Script
Share this article:Add on Google

Google Apps Script is a free Google platform that lets you automate Google Sheets, Gmail, Calendar, Docs, Forms and Drive with short pieces of JavaScript. You write the script in your browser, it is saved to Google Drive and runs on Google's servers – nothing to install and no server of your own. It is a good fit for repetitive work around spreadsheets and email: summaries, alerts, copying form responses or generating documents.

In short:

  • Price: Apps Script is available with a regular Google account (gmail.com) and in Google Workspace; only the daily quotas differ.
  • What it does: reads and writes spreadsheets, sends email, creates calendar events, builds documents and calls external APIs.
  • Runs on its own: time-driven triggers (from every minute to once a month) and events such as a form submission or a spreadsheet edit.
  • Limits: a single execution may run for up to 6 minutes; triggers have a daily cap of 90 minutes (gmail.com) or 6 hours (Workspace).
  • When to use something else: to connect many apps outside Google, Make, Zapier or n8n is usually more practical.

What is Google Apps Script

Google describes Apps Script (often shortened to GAS) as a rapid application development platform for business applications that integrate with Google Workspace. You write modern JavaScript and get built-in libraries for each service: SpreadsheetApp for Sheets, MailApp and GmailApp for email, CalendarApp for Calendar, DocumentApp for Docs, DriveApp for Drive and UrlFetchApp for calling external APIs.

A script can be bound to a specific file (a spreadsheet, document or form) – you open it from that file's menu, and it can add custom menus or dialogs to the file or react when it is opened. Or it can be standalone and work with several files at once. For most business automations built around one spreadsheet, a bound script is enough.

Apps Script also goes beyond background automation: custom functions you can use in cells (for example =CONVERT_PRICE(A1)), macros in Sheets, simple web apps and add-ons for the Google Workspace Marketplace.

What you can automate with Google Apps Script

The biggest time savings come from tasks someone does by hand every day or week, following the same steps. Typical examples in small and mid-sized businesses:

TaskApps Script servicesWhat starts the script
Confirmation email after an enquiry form is submittedFormApp, MailAppform submission
Daily or weekly spreadsheet summary by emailSpreadsheetApp, MailApptime-driven trigger
Copying dates from a spreadsheet into Google CalendarSpreadsheetApp, CalendarAppspreadsheet edit or time-driven trigger
Quote or contract from a Docs template, saved as PDFDocumentApp, DriveAppcustom menu in the spreadsheet
Pulling data from an external system (rates, orders, stock)UrlFetchApp, SpreadsheetApptime-driven trigger
Checking a spreadsheet for duplicates or missing dataSpreadsheetAppopening the file or a custom menu

This turns a spreadsheet into a simple workflow without extra software. UrlFetchApp can also call AI models – how connecting to language models works is covered in our OpenAI API guide.

How to write your first Google Apps Script step by step

The steps below create a script that emails a summary of new orders from a spreadsheet once a day. This is a model example – an ‘Orders’ sheet with the order number in column A, the customer in B, the amount in D and the status in E.

  1. 1Open the spreadsheet in Google Sheets and choose Extensions > Apps Script. The editor opens with a Code.gs file.
  2. 2Delete the empty placeholder function and paste the code below. Adjust the sheet name, column numbers and email address.
  3. 3Save the project (disk icon or Ctrl+S) and give it a name, such as ‘Order summary’.
  4. 4Select the sendOrderSummary function at the top and click Run. On the first run Google asks for authorisation – the script wants to read the spreadsheet and send email on your behalf.
  5. 5Check the execution log at the bottom of the editor. If the script failed, it shows the line where it stopped.
  6. 6In the left panel open Triggers (the alarm clock icon), click Add trigger, choose the function, a time-driven event source and a daily interval, for example 7–8 am.
javascript
// Model example: daily email summary of new orders
function sendOrderSummary() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Orders');
  const rows = sheet.getDataRange().getValues(); // read the whole table in one call
  const newOrders = rows.slice(1).filter(r => r[4] === 'new'); // column E = status
  if (newOrders.length === 0) return; // nothing new, no email

  const text = newOrders.map(r => r[0] + ' | ' + r[1] + ' | €' + r[3]).join('\n');
  MailApp.sendEmail('sales@example.com', 'New orders: ' + newOrders.length, text);
}

Note that the script reads the whole table with a single getValues() call and then works with the data in memory. Reading cell by cell is far slower and on larger sheets will hit the six-minute limit.

If you would rather not start with code, record a macro first: Extensions > Macros > Record macro, perform the steps in the sheet and save. Google stores the macro as an Apps Script function, so you can open the code and edit it.

Triggers: how a script runs on its own

A trigger decides when a function runs without you clicking anything. Apps Script has two kinds:

  • Simple triggers are functions with reserved names, such as onOpen() when a file opens or onEdit() when a cell changes. They need no setup, but they run for at most 30 seconds, only work in a script bound to a file and cannot use services that require authorisation – so they cannot send email.
  • Installable triggers are set up in the editor or in code. There are time-driven, open, edit, change, form submit and calendar event triggers. They can use services that require authorisation.

Two things about installable triggers are worth knowing up front. They always run under the account of the person who created them – if that person leaves and their account is deleted, the automation stops. And Google randomises the start time slightly: a daily trigger set for 9:00 runs between 9 and 10 am. When a trigger fails, Apps Script emails the owner a summary of the errors.

Triggers do not fire on changes made by another script or through an API. If an external system fills the spreadsheet, onEdit() will not run – use a time-driven trigger that checks for new rows instead.

Google Apps Script quotas and limits

Apps Script is free, but it has daily per-user quotas. They reset 24 hours after the first request, and Google may change them at any time. The key values from Google's documentation (as of November 2026):

Limitgmail.com accountGoogle Workspace
Script runtime per execution6 min6 min
Total trigger runtime per day90 min6 h
Email recipients per day (MailApp)1001,500
UrlFetch calls per day20,000100,000
Calendar events created per day5,00010,000
Triggers per user per script2020

Three practical takeaways for a business. Do not use Apps Script for bulk mailings – that is what email marketing with a proper sending tool is for. Process large data sets in batches. And run business automations from a Google Workspace account, not a personal gmail.com: the limits are higher and the account does not disappear when one person leaves.

Google Apps Script or Make, Zapier and n8n?

Apps Script and tools such as Make or Zapier are not mutually exclusive. What matters is where the data lives and who will maintain the automation.

Google Apps ScriptMake, Zapier, n8n
Pricefree within quotasfree tier with limits, then a monthly subscription
How you buildJavaScript codevisual editor
Strongest inSheets, Gmail, Calendar and Driveconnecting hundreds to thousands of apps
External appsthrough their APIs, all by handready-made connectors
Maintenanceneeds someone who understands codea non-developer can make changes

Choose Apps Script when the automation revolves around a spreadsheet and Google services and you have someone who can maintain the code. Make, Zapier or n8n are better for connecting a CRM, online shop, invoicing and other systems – see our n8n vs Zapier vs Make comparison. They are often combined: a spreadsheet with Apps Script prepares the data and Make passes it on.

Common mistakes when automating with Apps Script

  • API keys and passwords in the code. Anyone with access to the spreadsheet can often see the script too. Store secrets in script properties (PropertiesService).
  • A trigger owned by one employee. Create it from a shared company account and note who looks after it.
  • Reading and writing cell by cell. Use getValues() and setValues() for whole ranges, or the script will hit the 6-minute limit.
  • No error handling. Without try/catch and checks for empty rows, the script fails on the first unexpected value. Do not leave trigger failure emails unread for a month.
  • Undocumented automations. A year later nobody knows which script sends which emails. A simple list is enough: what the script does, where it runs, who owns it.

When to hand automation to a specialist

A simple summary or confirmation email is within reach of a capable spreadsheet user following the guide above. But once orders, invoicing or customer communication depend on a script, you need error handling, backups and someone who maintains it. The same applies when a spreadsheet has grown into the role of a CRM system and Apps Script is just holding it together.

At Weboptim we first map what repeats in your business and then choose the simplest tool – sometimes Apps Script, sometimes Make, Airtable or a direct API integration. If you would like us to review your processes, see our digitalisation and automation service.

Frequently asked questions

What is Google Apps Script?
Google Apps Script is a free Google platform for automating Google Workspace services with JavaScript. You write scripts in a browser-based editor, they are saved to Google Drive and run on Google's servers. It works with Sheets, Gmail, Calendar, Docs, Forms and Drive and can call external APIs.
Is Google Apps Script free?
Yes, Google Apps Script is free with a regular Google account and in Google Workspace. Daily quotas apply: a gmail.com account can email at most 100 recipients a day from scripts and triggers can run for 90 minutes a day in total, while a Workspace account gets 1,500 recipients and 6 hours.
Do I need to know how to code to use Apps Script?
For simple tasks the basics are enough. You can start by recording a macro in Google Sheets, which is saved as Apps Script code, and then edit it. For automations that orders or customer communication depend on, it pays to have someone who understands JavaScript and can maintain the script.
How often can a script run automatically?
A time-driven trigger in Apps Script can run anywhere from every minute to once a month. Google randomises the exact time slightly, so a daily trigger set for 9:00 runs between 9 and 10 am. A single execution may last at most 6 minutes.
What is the difference between a macro and Apps Script?
A macro in Google Sheets is a recorded sequence of steps that Google saves as an Apps Script function. Apps Script is the whole environment those functions run in, where you can also send email, work with Calendar, Drive or external APIs and set up automatic triggers.
Peter Gáborík

Written by

Peter Gáborík

Project Manager – AI, Automation & SEO

Project manager and founder of Weboptim. Builds growth strategies around SEO, automation and AI; in online marketing since 2017.

Tips that save time – once a month

One e-mail a month: a new guide, the automation of the month and one number from practice. No spam.