Skip to content
Skip to chapter

Chapter 38

Reference and glossary

Reference, glossary, and troubleshooting

Find the right Apps Script term, service reference, example, or troubleshooting guide when maintaining a production script.

By the end

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.

Chapter navigation

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

TermDefinition and consequenceWhere to go next
Access tokenA short-lived bearer credential sent to a resource API. The provider may stop accepting a saved token.Access and refresh lifetimes
Advanced serviceAn 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 parameterAn 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
ArrayAn 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
AuthenticationEstablishing the identity of a caller. Knowing who the caller is does not decide what that caller may do.Consent and remote authentication
AuthorizationDeciding which operations an identity may perform. OAuth scopes do not replace provider roles, resource permissions, or organization policy.Separate grants and resource access
Bound scriptA 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
CacheDisposable 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
CallbackA 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 builderA 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
CheckpointPersisted 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
CoercionAutomatic conversion between value types. Strict comparison avoids some implicit conversions, but an explicitly converted value still needs validation.Values and objects
Content-TypeResponse 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 functionA 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 validationRules 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
DeploymentA 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
DiagnosticA 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
EndpointThe API address and operation a client intends to call. Its provider defines the request format, authentication, and responses.Describe an HTTP request
ExecutionOne 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 identityThe 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 eventThe 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
HMACA message-authentication code computed from agreed bytes and a shared key. It authenticates those bytes but does not encrypt them.Authenticated event fields
Installable triggerA 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
InstantA 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
JSONA text format for data. Parsing reconstructs a value but does not prove its expected fields, types, or business meaning.Response parsing and validation
LibraryAnother 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
LockCoordination 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
Manifestappsscript.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 valuenull 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 propertyAn 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 URIThe 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 grantProvider 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 scopeA named permission, such as access to spreadsheets or external requests. The manifest lists the scopes the user is asked to grant.Authorization scopes
PaginationReading 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 serviceStored 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 helperA 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
QuotaA limit on service or account use, often measured over time. Exceeding it makes the service call fail with a quota error.Current quotas
RangeA selected rectangle of spreadsheet cells. The two-dimensional array passed to setValues() must match its dimensions.Batched Sheets work
ReconciliationChecking 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 tokenA 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 revisionA 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, lexicalThe 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 IDThe identifier of an Apps Script project, shown in Project Settings. Library consumers and clasp use it to find the project.clasp guide
Simple triggerA reserved function such as onOpen that runs automatically under simple-trigger restrictions. It cannot use services that need authorization.Triggers explained
Smoke testA 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 scriptA 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 outputModel 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
TriggerAn event-driven execution, such as opening a file or a scheduled time. The trigger type decides which user the execution runs as.Triggers guide
UrlFetchAppThe 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
VersionA 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 appA 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
WebhookAn 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
iCalUIDThe 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.

SymptomFirst checkLikely next action
Authorization is requiredThe 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 errorThe 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 errorThe 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 appearThat 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 anotherWho 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 dataThe deployment's execution identity and audience.Review the deployment configuration and test in an approved isolated project.
An HTTP integration failsThe 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 uploadEmitted 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 versionThe 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 disappearedWhether 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 recordsThe 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 errorThe 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 functionThe 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 functionWhether 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 rangeEvery 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 rangeThe 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 invalidZero 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 definedSpelling, 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 definedAny 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 listUnclosed 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 literalMissing 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 tokenWhether 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: XThe 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: XThe 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 parametersThe 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 callsCalls 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.

ExampleWhat it demonstratesEffects
First Sheets scriptReading a supplied Sheets input.Reads the supplied customer rows. Does not write data.
Values and objectsValues, objects, and pure calculations before service workflows.Changes in-memory fictional data and writes execution-log messages.
Functions and decisionsNamed helpers, pure functions, and control flow.Runs in-memory request-routing helpers and writes execution logs.
JavaScript arraysTransforming, filtering, and mapping row collections.Processes in-memory request arrays without modifying external data.
Batch request statusesReading and updating rectangular Sheet ranges in batched calls.Reads request rows and writes batched status updates to a practice tab.
Custom functionsFormula-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 formattingAdding data validation rules, conditional formats, and edit timestamps.Modifies validation rules, formatting, and edit timestamps on a practice tab.
HTTP request previewInspecting a request before sending it.Logs a request description. Does not contact the sample host.
Public forecastValidating 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 samplePaginated 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 policyHistorical 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 triggersInstalling and removing repeat-safe time-driven triggers under lock.Creates an hourly trigger and updates blank statuses without duplicate triggers.
Request trackerThe continuing Sheets automation combining batching, state, and triggers.Updates request rows and can install a time-driven trigger.
Drive file copyCopying 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 generationCopying a Docs template, replacing text placeholders, and styling tables.Creates a copied document and writes formatted briefing tables.
Gmail draft preparationSearching 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 eventsDates, 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 formBranching, 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 deckCreating presentations, positioning shapes, and inserting metric cards.Creates a two-slide briefing deck in Google Drive.
Advanced Drive serviceDirect Google API calls with the Drive v3 advanced service.Queries Drive metadata with field masks without modifying files.
Bound Sheets menuReading a selected request through a menu or sidebar.Reads the selected row. Does not write data.
Request-status web appDeploying 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 receiptsA 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-onDrive 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 extensionType checking, diagnostics, and refactors in the editor.Analyzes code inside the browser editor without changing execution behavior.
Request tracker diagnosticsExecution timing, debugger breakpoints, structured logs, and resuming batches.Inspects spreadsheet rows and manages batch checkpoints in Script Properties.
Local request summaryA small local clasp workflow for a bound script.Reads a sheet and writes one execution-log line.
Test Apps Script codePure 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 buildsCompiling TypeScript with tsc into upload-ready .gs files for clasp.Compiles local .ts files into verified .gs output without changing runtime behavior.
Versioned request plannerA 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 grantConsent, 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 ScriptStructured JSON outputs, schema validation, and checkpointed batches.Calls Gemini, OpenAI, or Anthropic APIs and writes validated suggestions to Sheets.
Google Chat appDirect-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 eventsScoped 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 chartData 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 bundlesValidating 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:

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.