Reference, glossary, and troubleshooting
Find the right Apps Script term, service reference, example, or troubleshooting guide when maintaining a production script.
Find a precise source for a service, a way of running a script, an error, or an example instead of relying on a copied fragment.
Use this appendix to look up an Apps Script term, a common error, a book example, or the right reference page. Each glossary entry defines the term and explains how it affects your code. Google's official documentation is the authority for current APIs, quotas, deployment settings, and product policies.
Glossary
| Term | Definition and consequence | Where to go next |
|---|---|---|
| Access token | A short-lived bearer credential sent to a resource API. The provider may stop accepting a saved token. | Access and refresh lifetimes |
| Advanced service | An Apps Script service that exposes a Google API after you enable it in the Apps Script editor. If the script uses a standard Cloud project, you must also enable the API in that Cloud project. | Advanced services |
| Argument and parameter | An argument is a value supplied by a call, and a parameter is the local name that receives it inside the function. A call that supplies fewer arguments leaves the remaining parameters undefined. | Functions and calls |
| Array | An ordered collection accessed by zero-based indexes. A range's getValues() result is an array of row arrays, so changing it does not change the cells. | JavaScript arrays |
| Authentication | Establishing the identity of a caller. Knowing who the caller is does not decide what that caller may do. | Consent and remote authentication |
| Authorization | Deciding which operations an identity may perform. OAuth scopes do not replace provider roles, resource permissions, or organization policy. | Separate grants and resource access |
| Bound script | A project attached to one Sheets, Docs, Slides, or Forms file. It can refer to that file with methods such as SpreadsheetApp.getActiveSpreadsheet(). | Bound versus standalone scripts |
| Cache | Disposable stored data that can be recomputed. The value can disappear before its requested expiration, so code must be able to rebuild it. | Rebuild a cached summary |
| Callback | A function passed to another function to be called as part of its work. An array callback runs inside the current execution, so it is not a trigger or a new execution. | Array transformations |
| Chart builder | A changeable description used to construct a chart. build() produces a chart object, and inserting or updating that object is a separate Sheets operation. | Building versus saving a chart |
| Checkpoint | Persisted progress used to decide what work to inspect or attempt next. It does not make a separate service action transactional or exactly-once. | Local plans and external checkpoints |
| Coercion | Automatic conversion between value types. Strict comparison avoids some implicit conversions, but an explicitly converted value still needs validation. | Values and objects |
| Content-Type | Response metadata describing the body's format. It is separate from the Accept request header, and valid JSON still needs shape and value checks. | Check responses in stages |
| Custom function | A spreadsheet formula function written in Apps Script that returns a value to a cell. It cannot change other cells or use services that need authorization. | Custom functions |
| Data validation | Rules that restrict what a user can enter into a spreadsheet cell. Validation written by a script can preserve or replace manual rules. | Sheets validation and formatting |
| Deployment | A released configuration of a script, such as a web app or add-on. A versioned deployment keeps serving its version until you update the deployment. | Deployments |
| Diagnostic | A code checker warning or error that identifies a mistake before or during script execution. It names the problem and the line, and fixing the code is a separate step. | Find mistakes with diagnostics |
| Endpoint | The API address and operation a client intends to call. Its provider defines the request format, authentication, and responses. | Describe an HTTP request |
| Execution | One invocation of script code, with its own local variables, identity, and limits. A later execution does not recover an earlier execution's local variables. | State across runs |
| Execution identity | The user whose permissions apply to one execution. The same function can run as different users from the editor, a trigger, or a web app. | Authorization guide |
| Form-submit event | The event supplied to an installed submission handler. A Forms event contains a FormResponse, and a linked-Sheets event has a different shape. | Actual Forms events |
| HMAC | A message-authentication code computed from agreed bytes and a shared key. It authenticates those bytes but does not encrypt them. | Authenticated event fields |
| Installable trigger | A trigger created by a user. It runs under that creator's account, so a trigger created by one person can behave differently from one created by another. | Safe triggers |
| Instant | A point on the timeline represented by a JavaScript Date. A display time zone changes how the instant is shown, and an all-day calendar date is a different kind of value. | Calendar dates and instants |
| JSON | A text format for data. Parsing reconstructs a value but does not prove its expected fields, types, or business meaning. | Response parsing and validation |
| Library | Another Apps Script project included by Script ID and version number. The consumer project must have read access to the library script. | Producer and consumer projects |
| Lock | Coordination among participating executions within a defined scope. Acquire it before reading the state you will update. It does not block other services or human edits. | Protect read-modify-write |
| Manifest | appsscript.json, the project configuration file for runtime settings and explicit scopes. Editing its scope list changes what the script asks the user to grant at the next authorization. | Manifests |
| Nullish value | null or undefined. Zero, false, and an empty string are not nullish, so a truthiness check used for defaulting can discard those meaningful values. | Values and missing data |
| Object and property | An object groups named values, and a property is one of those entries. Changing a shared object's property is visible through every reference to the same object. | Values and objects |
| OAuth callback URI | The registered address to which the provider returns the browser after authorization. The OAuth2 library's Apps Script /usercallback URI is not a web-app /exec URL. | Register the exact callback |
| OAuth grant | Provider authorization for a client to act with specified permissions. It is separate from Apps Script's own consent and does not share a file with the authorizing account. | Two authorizations |
| OAuth scope | A named permission, such as access to spreadsheets or external requests. The manifest lists the scopes the user is asked to grant. | Authorization scopes |
| Pagination | Reading a larger result one page at a time, in the way the provider defines. Stopping at a local page or item limit does not mean that every record was read. | Read a small paginated sample |
| Properties service | Stored string values shared by a script, by the executing user, or by an eligible document. Changing a value you read does not update the stored property until you write it back. | Choose a property store |
| Pure helper | A function whose return value depends only on its parameters and that makes no service calls or state changes. It can be tested without Google services. | Functions and decisions |
| Quota | A limit on service or account use, often measured over time. Exceeding it makes the service call fail with a quota error. | Current quotas |
| Range | A selected rectangle of spreadsheet cells. The two-dimensional array passed to setValues() must match its dimensions. | Batched Sheets work |
| Reconciliation | Checking recorded state and target resources after an interrupted write to determine whether the operation succeeded. Doing it before a retry stops the retry from repeating a write that already happened. | Calendar create recovery |
| Refresh token | A longer-lived credential used to request another access token without a new consent round trip. It can still expire or be revoked. | Observe actual refresh behavior |
| Schema and revision | A schema defines the shape of stored data and the rules it must follow, and a revision identifies one state update within a format version. A record with an unsupported version needs repair, not silent reinitialization. | Versioned state records |
| Scope, lexical | The region of code where a variable name is available. It is unrelated to an OAuth scope or a Properties sharing scope. | Functions and scope |
| Script ID | The identifier of an Apps Script project, shown in Project Settings. Library consumers and clasp use it to find the project. | clasp guide |
| Simple trigger | A reserved function such as onOpen that runs automatically under simple-trigger restrictions. It cannot use services that need authorization. | Triggers explained |
| Smoke test | A fast test run against real services or a staging tab to verify that basic operations succeed. It catches setup and permission problems that local unit tests cannot. | Test Apps Script code |
| Standalone script | A project not attached to a container file. It has no active file, so it opens files by ID or URL. | Bound versus standalone scripts |
| Strict comparison | === and !== compare without converting one operand to the other's type. Comparing two objects this way checks identity, not matching fields. | Values and comparison |
| Structured output | Model responses constrained to a strict JSON schema. Script code can then parse and validate them like any other JSON. | Use AI models from Apps Script |
| Trigger | An event-driven execution, such as opening a file or a scheduled time. The trigger type decides which user the execution runs as. | Triggers guide |
| UrlFetchApp | The Apps Script service for HTTP and HTTPS requests. It needs the external-request scope, and each response still needs status, content type, and data checks. | HTTP response reference |
| Version | A numbered, immutable snapshot of Apps Script project source. Saved Head, a deployment, and the version a library consumer selects are different things. | Numbered library releases |
| Web app | A deployed doGet or doPost endpoint that returns HTML or text. Who can reach it and whose identity it runs as are deployment settings. | Web apps |
| Webhook | An event delivered by HTTP POST to a receiver endpoint. The receiver's authentication, status codes, and retry behavior must match what the sender expects. | Choose a request format both projects can handle |
| iCalUID | The CalendarApp event identifier returned by CalendarEvent.getId(). It is not interchangeable with Calendar REST event.id, and it needs the calendar context stored with it. | Stored Calendar identities |
Troubleshooting index
Record the exact error text, how you started the script, and when it ran. The Apps Script dashboard can show project executions and health data, but what it shows depends on your access to the project.
| Symptom | First check | Likely next action |
|---|---|---|
Authorization is required | The execution identity and the current manifest scopes. | Run the authorized setup flow as the relevant user. A background trigger cannot prompt for a missing permission. |
Cannot call ... of null or a missing sheet error | The file, sheet name, and selected range used by the code. | Stop with a descriptive check before reading or writing. See common errors. |
Service invoked too many times or a limit error | The current quota page and how often the code calls the service. | Batch operations, reduce frequency, and checkpoint work. Do not guess a wait period from an old blog post. |
| A menu does not appear | That the project is bound to the file, saved, and has an exact onOpen function. | Reload the file. See custom menus. |
| A trigger worked for one person but not another | Who created the installable trigger and what they authorized. | Review trigger ownership and recreate it under the intended owner if appropriate. |
| A web app reaches the wrong data | The deployment's execution identity and audience. | Review the deployment configuration and test in an approved isolated project. |
| An HTTP integration fails | The status code, provider's documented response, and redacted request metadata. | Do not retry a write until you know whether the remote system received it. See Fetch data from web APIs. |
| A local change differs after upload | Emitted source, manifest, runtime, and target Script ID. | Inspect the upload configuration and execution log. See Local Apps Script development with clasp. |
| The saved state no longer parses or has an unsupported version | The exact property key, stored format, and source version. | Preserve the original value before inspecting it. Do not silently initialize over it. See recovering a bad record. |
| A cache entry disappeared | Whether the result can be recomputed from the original data. | Rebuild the result. A cache miss is not missing business state. |
| A paginated read stops with only some records | The page and item limits, the provider's next link, and whether the result was reported as partial. | Record whether you read every page or stopped early, and check failures before repeating requests. |
| An output ID is missing after a create error | The saved intent, exact target, and any recovery marker. | Treat the result as uncertain. A null lookup, empty search, or local error does not by itself authorize another create. |
TypeError: X is not a function | The receiver's class and the exact method name. | Check the name against the declared methods for that class. See TypeError: X is not a function and choose the right service call. |
Cannot read properties of null (reading 'getRange') | The sheet lookup one line earlier. | Guard the nullable result before dereferencing it. See Cannot read properties of null and JavaScript arrays. |
TypeError: e.range is not a function | Whether range is a property of the event object. | Drop the call parentheses, because the property is already a Range. See TypeError: e.range is not a function and trigger event objects. |
Cannot read properties of undefined (reading 'setDataValidation') | The index or lookup that produced the range. | Fix the out-of-range index or the lookup that returned nothing. See Cannot read properties of undefined. |
The number of columns in the data does not match the number of columns in the range | Every row of the 2D array has the same length. | Pad or trim the ragged row, then size the range from the data. See column count mismatch and JavaScript arrays. |
The number of rows in the data does not match the number of rows in the range | The outer array length against the range height. | Size the range from values.length instead of a separate count. See row count mismatch and batching writes. |
The coordinates or dimensions of the range are invalid | Zero or negative rows, columns, or sizes in the getRange call. | Guard empty results and remember coordinates are one-based. See invalid range dimensions and batching writes. |
ReferenceError: X is not defined | Spelling, scope, and whether every project file saved. | Fix the typo or move eager top-level code into functions. See ReferenceError: X is not defined and functions and calls. |
ReferenceError: GoogleAppsScript is not defined | Any use of the type namespace in a value position. | Use the service globals at runtime and keep GoogleAppsScript.* in type positions. See GoogleAppsScript is not defined and TypeScript builds. |
Missing ) after argument list | Unclosed parentheses in nested calls above the reported line. | Close the delimiter the parser flagged. Check the opening line as well as the reported one. See Missing ) after argument list and debug executions. |
Unterminated string literal | Missing quotes and non-ASCII quotes pasted from documents. | Close the string or use a template literal for multiline text. See Unterminated string literal. |
JSON.parse errors such as Unexpected token | Whether the argument is a string, and what the endpoint returned. | Parse response.getContentText() and check for an empty, incomplete, or non-JSON body. See JSON.parse errors and connect services. |
Script function not found: X | The function name in the trigger, menu item, or google.script.run call. | Export a top-level function with that exact name and save every file. See Script function not found and menus and interfaces. |
Exception: No HTML file named X was found. | The file name passed to createHtmlOutputFromFile or createTemplateFromFile. | Pass the exact HTML file name without the .html extension. See No HTML file named X was found and menus and interfaces. |
Invalid email: X | The recipient string passed to MailApp.sendEmail or GmailApp.sendEmail. | Trim and validate each recipient address, and skip header rows and blank cells. See Invalid email and Gmail workflows. |
Expected 3-4 arguments, but got 0 or a call missing required parameters | The arguments passed to the method call (such as recipient, subject, and body on GmailApp.createDraft). | Pass every required argument in the declared order before running the script. See missing required GmailApp arguments and Gmail workflows. |
Slow spreadsheet loops or Exceeded maximum execution time on per-row calls | Calls such as getValue(), setValue(), or appendRow() inside a loop. | Read a rectangular range once with getValues() and write changes back in one setValues() call. See spreadsheet service call inside a loop and batching writes. |
Do not paste production tokens, private rows, or unredacted HTTP bodies into a support request or public issue. The Apps Script logging guide explains the privacy protections that apply to Apps Script logs.
Include these details in a report:
The execution time and how you started the script.
Input that reproduces the problem without private data.
The exact error text.
The smallest code path involved.
Example catalog
Each example is a runnable project or a read-only preview. The linked chapter explains how to set up and run it, and the Effects column says what the example reads or changes.
| Example | What it demonstrates | Effects |
|---|---|---|
| First Sheets script | Reading a supplied Sheets input. | Reads the supplied customer rows. Does not write data. |
| Values and objects | Values, objects, and pure calculations before service workflows. | Changes in-memory fictional data and writes execution-log messages. |
| Functions and decisions | Named helpers, pure functions, and control flow. | Runs in-memory request-routing helpers and writes execution logs. |
| JavaScript arrays | Transforming, filtering, and mapping row collections. | Processes in-memory request arrays without modifying external data. |
| Batch request statuses | Reading and updating rectangular Sheet ranges in batched calls. | Reads request rows and writes batched status updates to a practice tab. |
| Custom functions | Formula-driven calculations returned directly to spreadsheet cells. | Returns values to the calling cells and changes no other data. A test function writes execution-log messages. |
| Sheets validation and formatting | Adding data validation rules, conditional formats, and edit timestamps. | Modifies validation rules, formatting, and edit timestamps on a practice tab. |
| HTTP request preview | Inspecting a request before sending it. | Logs a request description. Does not contact the sample host. |
| Public forecast | Validating external JSON before one Sheets write to a fixed range. | Makes one public GET and replaces the reserved Forecast!A1:C12, including attribution. |
| Public repository sample | Paginated reads with separate record, page, and retry limits. | Reads a limited amount of public GitHub metadata and logs a sample that may be partial. |
| Persisted request policy | Historical local decisions, per-user preferences, and disposable cache. | Writes named Properties and cache entries. Does not book a room or send a message. |
| Safe time-driven triggers | Installing and removing repeat-safe time-driven triggers under lock. | Creates an hourly trigger and updates blank statuses without duplicate triggers. |
| Request tracker | The continuing Sheets automation combining batching, state, and triggers. | Updates request rows and can install a time-driven trigger. |
| Drive file copy | Copying a known Drive file by ID into a destination folder and recording the created file ID. | Copies one configured template file into a selected Drive folder and stores the copy ID in Script Properties. |
| Docs report generation | Copying a Docs template, replacing text placeholders, and styling tables. | Creates a copied document and writes formatted briefing tables. |
| Gmail draft preparation | Searching test threads, creating drafts, and reconciling draft state with the Gmail advanced service. | Searches matching threads, creates Gmail drafts, and records draft IDs in Script Properties without sending mail by default. |
| Known Calendar events | Dates, instants, stored identities, and reconciliation after an uncertain create. | Creates or updates a small, capped number of practice events in a selected secondary calendar. |
| Private workshop form | Branching, quiz feedback, native submission events, and known response IDs. | Creates a practice form and an owner-installed trigger. The optional exercise stores fictional submissions. |
| Slides briefing deck | Creating presentations, positioning shapes, and inserting metric cards. | Creates a two-slide briefing deck in Google Drive. |
| Advanced Drive service | Direct Google API calls with the Drive v3 advanced service. | Queries Drive metadata with field masks without modifying files. |
| Bound Sheets menu | Reading a selected request through a menu or sidebar. | Reads the selected row. Does not write data. |
| Request-status web app | Deploying doGet endpoints, HTML service templates, and user authorization. | Serves a private HTML lookup page from a standalone project connected to a practice spreadsheet. |
| Custom event receipts | A sender and receiver that authenticate each event, with the receiver remembering event IDs to detect duplicates. | Sends small, size-checked HTTP events and writes the receiver's receipt log. Does not send email or create files. |
| Workspace add-on | Drive homepage trigger, CardService cards, validated card actions, and user-scoped state. | Renders a personal checklist card in the Drive side panel and stores user-scoped state without reading Drive files. |
| myFunction extension | Type checking, diagnostics, and refactors in the editor. | Analyzes code inside the browser editor without changing execution behavior. |
| Request tracker diagnostics | Execution timing, debugger breakpoints, structured logs, and resuming batches. | Inspects spreadsheet rows and manages batch checkpoints in Script Properties. |
| Local request summary | A small local clasp workflow for a bound script. | Reads a sheet and writes one execution-log line. |
| Test Apps Script code | Pure helper unit tests with Node.js and editor smoke tests on Sheets. | Runs local assertions. The smoke test creates and removes a disposable test tab. |
| TypeScript builds | Compiling TypeScript with tsc into upload-ready .gs files for clasp. | Compiles local .ts files into verified .gs output without changing runtime behavior. |
| Versioned request planner | A producer's public calculation and a consumer's pinned version selection. | Calculates fictional input and logs results. Setup creates private projects and numbered library releases. |
| Separate OAuth grant | Consent, callback, per-user token storage, refresh, and revocation. | Configures and changes a provider grant, reads a fixed practice range, and maintains local credential state. |
| Use AI models from Apps Script | Structured JSON outputs, schema validation, and checkpointed batches. | Calls Gemini, OpenAI, or Anthropic APIs and writes validated suggestions to Sheets. |
| Google Chat app | Direct-message events, interactive Chat cards, card updates, and what happens when the app is removed. | Responds to direct-message request lookups with interactive cards and updates card state in Google Chat. |
| GitHub issues and Actions events | Scoped GitHub REST reads from Apps Script and signed event receipts from GitHub Actions. | Reads one configured private issue through the GitHub REST API and records a signed Actions receipt in the custom endpoint. |
| Known embedded chart | Data versus presentation, builders, and updating the same chart on later runs. | Creates and updates one chart in a selected practice spreadsheet. Uncertain creation requires inspection, not another insert. |
| File format bundles | Validating tabular input and packaging CSV, JSON, and a Doc-exported PDF into a ZIP archive. | Reads a practice spreadsheet, exports a Google Doc to PDF, and creates one private ZIP bundle in Google Drive. |
Reference map
Choose the narrowest maintained reference for your question:
Need a method signature or service behavior? Use the official Apps Script reference, then the site's Google Sheets service guide when it has a curated page.
Need a self-contained recipe? Start with the task guides, such as importing a web API or adding a custom Sheets menu.
Need to decode an error message or editor warning? Start with the error and diagnostic guides and diagnostic rule coverage.
Need a platform concept? Use the official guides, then return to the relevant book chapter for its place in the sequence.
Need current quotas, authorization scopes, or deployment guidance? Check the official documentation, because these change more often than a chapter does.
For databases, domain-wide delegation, and BigQuery, start with the owning product's official documentation. Google Chat apps, AI integrations, and add-on publication have their own chapters: Post notifications to Google Chat, Use AI models from Apps Script, and Install and release a Workspace add-on. Their product documentation remains the authority for current policy, and each integration has its own authorization, billing, and operating requirements.
To maintain an existing project, return to debugging and quotas and local development.