apps-script-utils 2.1.1 Help

appendRow

function appendRow( target: GoogleAppsScript.Spreadsheet.Sheet | GoogleAppsScript.Spreadsheet.Range, values: unknown, options: AppendRowsOptions | null | undefined = {} ): GoogleAppsScript.Spreadsheet.Sheet;

A sheet is examined whole and the row is written from column 1; a range is examined only inside itself and the row is written on its columns, below the last row of the range that holds data.

It is appendRows with one row: the same guards, the same growth of the sheet when the result would not fit, and the same rule that a cell whose text starts with = becomes a formula.

Parameters

Parameter

Type

Description

target

GoogleAppsScript.Spreadsheet.Sheet \| GoogleAppsScript.Spreadsheet.Range

The sheet to append to, or the range to append within.

values

unknown

A single row: a flat array, one value per column.

options (optional) = {}

AppendRowsOptions \| null \| undefined

afterFrozenRows starts the write below the frozen rows when the data ends before them.

Returns

GoogleAppsScript.Spreadsheet.Sheet — the sheet, so calls can be chained.

Throws

Exception

Condition

IllegalArgumentException

no argument is passed.

InvalidSheetException

the first argument is neither a sheet nor a range.

TypeError

the values are not a flat array.

Examples

Appending to a sheet

const sheet = SpreadsheetApp.getActiveSheet(); appendRow(sheet, ["Ada", "ada@example.com", "=TODAY()"]);

Appending within a range

const sheet = SpreadsheetApp.getActiveSheet(); appendRow(sheet.getRange("B1:D10"), ["Ada", "ada@example.com"]);

See also

Source

src/appsscript/sheet/appendRow.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.