Google Sheets — Write sheet
Google Sheets — Write sheet
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
values | DataTable | DataRow | — | The data to write (values only, no headers). |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanGoogleSheetsSession | — | Session from Google Sheets — Open. Inside Open’s body it is inherited and you can leave it empty. |
sheet | string | — | Sheet name. If empty, writes to the first sheet. |
Output
Section titled “Output”This activity does not return a value. The log shows how many cells were written.
Common errors
Section titled “Common errors”| Message | Cause 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. |
Example
Section titled “Example”Replace the content of a sheet with the data from a local Excel file:
Read Excel Sheet path = asset("data.xlsx") → output: tableGoogle Sheets — Clear range session = book sheet = "Imported" range = "A:Z"Google Sheets — Write sheet session = book sheet = "Imported" values = tableRelated activities
Section titled “Related activities”- Write range — write at a specific position.
- Append rows — append at the end without overwriting.
- Clear range — clear before writing.