Google Sheets steps: add, find and update a row
Add a row to a Google Sheet, find the first row where a column equals a value, and update a row by number. Setup, matching by column name, outputs and limits.
Updated
Four steps work with a Google Sheet: Add row appends a row, Find row looks one up by a column, Find rows lists every row that matches, and Update row changes a row by its number.
How to set it up
- Add the step and connect a Google account. Foliot only sees the spreadsheets you pick.
- Choose the spreadsheet and tab. The tab's first row must hold the column names.
- Fill in the step's fields (below), inserting data with + Data.
- Test this step runs it for real on your sheet.
Add row to Google Sheets
- One field per column, matched by the column's name.
- The row is added at the bottom. Values that look like formulas are stored as text.
Find row in Google Sheets
- Finds the first row where a column equals a value, with the same “is” rule as Filter: case and surrounding spaces are ignored, numbers compare as numbers.
- Output:
found: true,rowNumberand one value per column, orfound: false. Not finding a row isn't a failure. - Find rows has the same settings but gives every matching row (the first 100) as a list,
rows, pluscount; leave the value empty for every row. Loop over it with For each, or send it in one digest email. No match gives an empty list, not a failure.
Update row in Google Sheets
- Needs a row number, usually the
rowNumberfrom Find row, and one field per column. Empty fields keep the cell as it is.
A common pattern: Find row, then a Branch on found with Update row on the Yes path and Add row on the No path.
Limits
- Adding a row is retried only when the request certainly didn't reach Google. After a timeout or a Google server error the run fails and asks you to check the sheet, then re-run, so you never get a duplicate row.
- Add row on a tab watched by the New row trigger starts that workflow again. The editor warns you.
- The rows live in your Google account, not in Foliot.