Skip to content

Google Sheets — Read range

Type: googlesheets-read-range  ·  Package: Google Sheets Activities v1.0.5  ·  Output: DataTable

Reads a specific range of cells into a DataTable. Same as Read sheet, but limited to a range in A1 notation: handy when you only need part of the sheet, or when the data does not start at A1.

Reads range in the sheet sheet (the first one if empty). Google returns from the first cell of the range to the last row and column with data inside it, so A:E does not bring back thousands of empty rows.

  • With has-headers = true, the first row of the range provides the column names.
  • With has-headers = false (default), columns are named Column1, Column2, …
  • Every cell arrives as text as displayed in the sheet; empty cells as "".
ParameterTypeDefaultDescription
rangestring—Range in A1 notation: A1:E10, A:E, 1:100.
ParameterTypeDefaultDescription
sessionZoanGoogleSheetsSession—Session from Google Sheets — Open. Inside Open’s body it is inherited and you can leave it empty.
sheetstring—Sheet name. If empty, the first sheet is used.
has-headersboolfalseUse the first row of the range as column names; otherwise Column1, Column2, …

Always a DataTable with text columns. If the range is empty, returns an empty DataTable (no columns or rows).

MessageCause and fix
'range' is required.range is empty or its expression returned null.
No Google Sheets session available. Provide 'session' from a googlesheets-open activity, or place this activity inside the Open activity's body …The activity is outside Open’s body and received no session. Move it inside the body or pass the saved session.
A column named '…' already belongs to this DataTable.With has-headers = true, two headers in the range have the same text.
The service sheets has thrown an exception. HttpStatusCode is …Google rejected the call: missing sheet or range, no access, expired token or quota exceeded. See Google API errors.
Google Sheets — Read range session = book sheet = "Summary" range = "B3:E50" has-headers = true → output: data
Log message = "Rows read: " + rowCount(data)