Google Sheets

The Google Sheets steps connect your workflows to your spreadsheets:

Use them to generate a document for every new row, keep a log of every generated document, update a status column, or pull data from a sheet into your documents.

Example

An operations manager tracks client orders in a sheet with an Order ID and a Status column. When an order form is submitted, the workflow:

  1. Generates an order confirmation with a Document step.
  2. Uses a Google Sheets - Write row step to update the Status column in the sheet.

Connect your account

  1. Add a Google Sheets step and click Sign in under Account.
  2. Sign in with Google and allow access.
  3. Back in the workflow editor, the Manage Google Access window opens. Click Add spreadsheets and pick the spreadsheets TemplateDocs may use.

TemplateDocs can only use the spreadsheets you approve. Approved spreadsheets are available to all workflows in your organization. To approve another spreadsheet later, click Add next to the Spreadsheet setting. Only the person who connected the Google account can add spreadsheets.

Trigger

The Google Sheets trigger starts a workflow when a row of a sheet is added or changed.

Settings

SettingDescription
Account, Spreadsheet and SheetThe sheet to listen to.
Table contains headerTurn this on if the first row holds column names. The header row never starts the workflow.
Column typesHow each column is read (see Write row).
Start whenOne of:
  • Row added - A row is added to the sheet.
  • Row changed - A row of the sheet changes. Choose a Column to start only when that column changes, or keep Any column.
Rows must match (optional)Conditions the row must match to start a run, for example a Status of Done. Without conditions, every added or changed row starts a run.
Include new rows (for Row changed)A new row also starts a run when it is created and matches the conditions. If you chose a Column, the column must be filled.

The trigger only listens while the workflow is published. Each new or changed row starts one run with the row's latest values. To try the workflow before publishing, click Test in the workflow editor and pick a row.

When runs start

The trigger checks the sheet after a few minutes of inactivity.

Output variables

  • Row - The row: its Row Number and one value per column.
  • Event Type - RowAdded or RowChanged. A new row that starts a Row changed trigger reads RowAdded.
  • Event Time - When the row was found.
  • Spreadsheet Name / Spreadsheet URL - The spreadsheet of the row.
  • Sheet Name - The sheet (tab) of the row.

Write row

Settings

SettingDescription
Account, Spreadsheet and SheetWhere to write.
ActionAppend row adds a new row at the bottom of the sheet. Update row changes an existing row.
Row valuesThe cell values, in column order. Type @ to insert variables or formulas. Date columns also let you pick a date or a date relative to today.
Table contains headerTurn this on if the first row holds column names. The values are then labeled by column name. Without a header, click Add column to add values for columns A, B, C and so on.

Updating a row

With Update row, you also set:

SettingDescription
Row to updateConditions that find the row, for example "Invoice Number is Invoice Number". Exactly one row must match. If more than one row matches, the step fails.
If no row matchesFail the step, Append the row, or Skip the step. An appended row also gets the values from your is conditions, unless you set those cells yourself.
Column typesHow each column is read when matching (Text, Number, Checkbox, Date or Date and time). Types are detected from the sheet. Change one only if it was detected wrongly.

Only cells with a value are updated. Empty values leave the existing cells unchanged.

Output variables

  • Spreadsheet ID / Spreadsheet URL - The spreadsheet that was written to.
  • Sheet Name - The sheet (tab) that was written to.
  • Updated Range - The cells that were written, such as Sheet1!A12:E12.
  • Updated Rows - The number of rows written (0 when skipped).
  • Operation - Appended, Updated or Skipped.

Example: append the client's name, email and agreement status to a spreadsheet.

Append the client's name, email and agreement status to a spreadsheet.

Find rows

Settings

SettingDescription
Account, Spreadsheet and SheetWhere to search.
Table contains headerTurn this on if the first row holds column names. The header row is then not returned as data.
Column typesHow each column is read (see above).
ConditionsClick Add condition and choose a column, a comparison (such as is, contains, is empty or is after) and a value. Choose All conditions or Any condition. With no conditions, every row is returned.
SortingClick Add sort to order the rows by one or more columns.
Maximum rowsUp to 1,000 rows. The default is 100.
When more rows matchFail the step or Return the first matching rows.

If no rows match, the step still succeeds and returns an empty list. The step can read sheets with up to 50,000 rows.

Output variables

  • Rows - The matching rows. Each row has a Row Number and one value per column.
  • Row Count - The number of rows returned.
  • Has More - true if more rows matched than the maximum.
  • Spreadsheet ID / Spreadsheet URL - The spreadsheet that was searched.
  • Sheet Name - The sheet (tab) that was searched.

Credits

The Google Sheets trigger is free (0 credits). Each Google Sheets action step that runs (Write row or Find rows) costs 1 credit. See Credits.