Skip to content

Google Sheets — Write sheet

Type: googlesheets-write-sheet  ·  Package: Google Sheets Activities v1.0.5  ·  Output: —

Writes a dataset to the sheet, starting at A1. It is the direct way to dump data into Google Sheets: a table read from Excel, the result of a query or a calculated report.

Writes values from A1 in the sheet sheet (the first one if empty), in a single call to Google. It is the same as Write range with range = "A1":

  • Accepts a DataTable or a DataRow; writes only the values, without the column names.
  • Values are interpreted as USER_ENTERED (formulas, numbers and dates as if you typed them).
  • It overwrites the area the data covers and does not delete what lies outside: if the sheet had more rows than the new table, those rows remain. To replace the whole content, run Clear range first.
ParameterTypeDefaultDescription
valuesDataTable | DataRow—The data to write (values only, no headers).
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, writes to the first sheet.

This activity does not return a value. The log shows how many cells were written.

MessageCause and fix
'values' is required.values is empty or its expression returned null.
'values' must be a DataTable (or a single DataRow).A list, text or another type was passed. Pass a DataTable.
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.
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.

Replace the content of a sheet with the data from a local Excel file:

Read Excel Sheet path = asset("data.xlsx") → output: table
Google Sheets — Clear range session = book sheet = "Imported" range = "A:Z"
Google Sheets — Write sheet session = book sheet = "Imported" values = table