Sheet Cells
Sheet Cells works with the rows of a Google Sheets tab as if it were a table: read all the rows, add a new row at the end, change a specific row or delete it. It takes the column names from the first row of the tab.
It is the simplest way to use a spreadsheet as a log: orders, contacts, incidents or any list the flow has to look up or add to. To create, duplicate or delete whole spreadsheets, use Spread Sheet.
When to use it
- Every request that comes in through a form should be recorded as a new row.
- An AI agent has to look up a price or product list kept in Google Sheets.
- When an order is delivered, you want to change its row to mark it as delivered.
- You want to remove the contacts who have unsubscribed from the list.
Configuration
You need a Google Sheets credential, which connects by signing in with your Google account. To add, change or delete rows, the credential needs the Create, Update, Delete, Read access; with Read Only you can only read. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Google Sheets credential of the account you work with. |
| Operation | What the component does. See Operations. Default: Add Row. |
| Mode of Input | How you point to the spreadsheet: By Selection shows a picker to choose it from your Drive; By Id asks for its ID; By Url asks for its link. Default: By Selection. |
| Select Spreadsheet / Spreadsheet ID / Spreadsheet URL | The spreadsheet you work with, depending on Mode of Input. Required. |
| Select Sheet | The tab you work with. The list loads when you choose the spreadsheet. |
| Row Number | Only in Update Row and Delete Row. The row number in the spreadsheet, the one you see on the left in Google Sheets. Required. In Delete Row it cannot be 1, because that is the row with the column names. |
| Type | Only in Add Row and Update Row. How the row values are given. Automatic shows one field per column, named as in the first row; From Data takes the values from the Values field; User Defined lets you type the values column by column. Default: Automatic. |
| (one field per column) | With Type on Automatic. The value written in each column. Each field is named after its column. |
| Values | With Type on From Data. Connect the row data here. If you connect a list, Add Row adds one row per item. |
| Number of Columns | With Type on User Defined. How many columns you are going to fill in. The fields Column 1, Column 2… appear for you to type each value. |
Operations
| Operation | What it does |
|---|---|
Add Row | Adds a new row after the last row with data. |
Update Row | Replaces the values of a specific row. |
Delete Row | Deletes a specific row. |
Get Rows | Returns all the rows in the tab. |
Advanced options
| Field | What it does |
|---|---|
| Declare Headers | Only in Get Rows. Uses the first row as column names. If you turn it off, the columns are called Column 1, Column 2… and the first row is returned as just another row. Default: on. |
Output
The component has two outputs:
- Data: in
Get Rows, one item per row, with one value per column and the row number in the spreadsheet (row_number). InAdd Row,Update RowandDelete Row, the area of the spreadsheet that was written or deleted. - Json: only in
Get Rows. The same rows as a single text, useful for passing them to an agent or to a component that expects text. Here the columns are always calledColumn 1,Column 2…
You can connect the rows to an AI agent so it looks them up, or use row_number in another Sheet Cells to change or delete that row. The component can also be connected to an Agent as a tool, so the agent reads or adds rows when it needs to. See Tool Mode.
Example
An estate agency records in a spreadsheet every viewing requested on its website.
- The
Viewingsspreadsheet has the columnsName,Phone,PropertyandDatein its first row. - Add Sheet Cells with the
Add Rowoperation, choose the spreadsheet in Select Spreadsheet and the tab in Select Sheet. - With Type on
Automatic, the fieldsName,Phone,PropertyandDateappear: fill them in with the data coming from the form. - Run the flow with a test request and check that the new row appears.
Good practices
- The first row of the tab must hold the column names. Without it,
Automaticshows no fields andUpdate RowandDelete Rowcannot find the table. - With Type on
From Data, the values are written in the order they arrive, from left to right, not according to the name of each value. Make sure they arrive in the same order as the columns. - If you add or change columns in the spreadsheet, choose the tab again in Select Sheet so the fields are updated.
Related components
- Spread Sheet: create, duplicate and manage spreadsheets.
- Forms: read the answers to a form to pass them to the spreadsheet.