> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Sheets

> Log, query, and update Google Sheets data from your conversational flows in Brain Studio.

**Google Sheets** is an accessible tool for teams that need structured data without setting up a database. Unlike Supabase (which connects to PostgreSQL and business logic) or a CRM (which enforces a predefined model), Sheets is flexible, shareable, and familiar for anyone on the team.

In **Brain Studio**, this integration lets your flows read, write, and transform spreadsheet data in real time: log leads, update statuses, consolidate reports, and orchestrate processes where the sheet acts as an operational control panel.

## What Google Sheets enables

When you connect **Google Sheets**, you can:

* **Log business events in shared spreadsheets** — leads, appointments, payments, or documents get structured directly from conversation
* **Query existing data before replying** — find a row by ID, read a range, or verify a status so the agent does not invent data
* **Update statuses and columns in real time** — mark as processed, add timestamps, or change values based on what happens in the flow
* **Govern spreadsheet structure** — conditional formatting, data validation, and range protection to maintain quality
* **Orchestrate processes across integrations** — use the sheet as a task queue where each row is a pending case the flow processes and marks done

***

## Installation

### Prerequisites

1. A **Google account** with access to **Google Sheets** and **Google Drive**.

### How to connect it

The most direct way is using [**Jelou Agent**](/en/guides/getting-started/jelou-agent): describe what you need and the agent connects **Google Sheets** automatically inside the flow.

If you prefer manual installation, follow these steps in **Marketplace**. The connection uses **Google OAuth**; you do not need to copy credentials.

<Steps>
  <Step title="Open Marketplace">
    In Brain Studio, open **Marketplace** from the side menu.
  </Step>

  <Step title="Search Google Sheets">
    Find **Google Sheets** in the catalog and click **Connect**.
  </Step>

  <Step title="Authorize access with Google">
    A secure Google authorization window will open. Sign in if needed and accept the requested permissions.
  </Step>

  <Step title="Confirm installation">
    Back in Brain Studio, complete the wizard until the integration appears as **connected**.

    <Check>
      In **Marketplace**, Google Sheets should appear as connected. From **Canvas** you can add its node, and in **AI Agent** → **Tools** you can enable it.
    </Check>
  </Step>
</Steps>

***

## Available tools

At a high level, actions are grouped as:

* **Query** — get cells, ranges, rows, tabs, and workbook metadata.
* **Create and structure** — create workbooks/tabs, insert rows/columns, and move dimensions.
* **Update data** — append, edit, clear, or upsert rows and cells.
* **Governance and quality** — validation, conditional formatting, protection, comments, and notes.

This integration exposes 31 tools in Brain Studio; below is each tool with purpose, inputs, and example.

## Features

<AccordionGroup>
  <Accordion title="Create column">
    Inserts a **new column** in a tab (typically `InsertDimension` or equivalent `batchUpdate` requests).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** / **sheetName** (string) — Tab.
    * **startIndex** (number) — Column index to insert at.
    * **endIndex** (optional, number) — For multiple columns.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetName": "Data",
      "startIndex": 2,
      "dimension": "COLUMNS"
    }
    ```

    [Google documentation: `spreadsheets.values.batchUpdate`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate) · [Sheet requests](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate)
  </Accordion>

  <Accordion title="Add conditional format rule">
    Adds a **conditional formatting rule** (color scale, boolean, custom formula, etc.).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** (number) — Tab ID.
    * **rule** (object) — Rule definition (`ranges`, `booleanRule`, `gradientRule`, etc.).

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetId": 0,
      "rule": {
        "ranges": [{ "sheetId": 0, "startRowIndex": 1, "endRowIndex": 100, "startColumnIndex": 0, "endColumnIndex": 1 }],
        "booleanRule": {
          "condition": { "type": "NUMBER_GREATER", "values": [{ "userEnteredValue": "0" }] },
          "format": { "backgroundColor": { "red": 0.8, "green": 1, "blue": 0.8 } }
        }
      }
    }
    ```

    [Google documentation: `AddConditionalFormatRuleRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#AddConditionalFormatRuleRequest)
  </Accordion>

  <Accordion title="Add multiple rows">
    **Appends** multiple rows to a table using `values.append`.

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — Base range (e.g. `Sheet1!A:C`).
    * **values** (2D array) — Rows to append.
    * **valueInputOption** (optional, enum: `RAW` | `USER_ENTERED`) — Default `USER_ENTERED`.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Sales!A:C",
      "values": [["2025-01", "Client A", 1500], ["2025-02", "Client B", 2200]],
      "valueInputOption": "USER_ENTERED"
    }
    ```

    [Google documentation: `spreadsheets.values.append`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append)
  </Accordion>

  <Accordion title="Add protected range">
    Adds a **protected range** with edit permissions (`AddProtectedRange`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (object) — Range to protect.
    * **editors** (optional, object) — Users or domains allowed to edit.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": {
        "sheetId": 0,
        "startRowIndex": 0,
        "endRowIndex": 1,
        "startColumnIndex": 0,
        "endColumnIndex": 5
      },
      "description": "Header row"
    }
    ```

    [Google documentation: `AddProtectedRangeRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#AddProtectedRangeRequest)
  </Accordion>

  <Accordion title="Add single row">
    Adds **one row** of data; optionally at an **index** (e.g. row 2 after headers).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — Target range or table.
    * **values** (array) — One row of values.
    * **insertDataOption** (optional, enum) — `INSERT_ROWS` or append options.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Data!A:D",
      "values": [["ID-99", "New", "2025-03-23", true]],
      "valueInputOption": "USER_ENTERED"
    }
    ```

    [Google documentation: `spreadsheets.values.append`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append)
  </Accordion>

  <Accordion title="Clear cell">
    Clears **content** of a single cell (`values.clear` on a one-cell A1 range).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — A1 cell (e.g. `Sheet1!B5`).

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Summary!C10"
    }
    ```

    [Google documentation: `spreadsheets.values.clear`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/clear)
  </Accordion>

  <Accordion title="Clear rows">
    Clears **content** for one or more rows.

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — Row range (e.g. `Sheet1!A5:Z20`).

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Import!A2:Z100"
    }
    ```

    [Google documentation: `spreadsheets.values.clear`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/clear)
  </Accordion>

  <Accordion title="Copy worksheet">
    Copies a **tab** to another spreadsheet (`sheets.copyTo`).

    **Inputs:**

    * **spreadsheetId** (string) — Source spreadsheet ID.
    * **sheetId** (number) — Source tab ID.
    * **destinationSpreadsheetId** (string) — Destination spreadsheet ID.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1SrcBookId",
      "sheetId": 123456789,
      "destinationSpreadsheetId": "1DstBookId"
    }
    ```

    [Google documentation: `spreadsheets.sheets.copyTo`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.sheets/copyTo)
  </Accordion>

  <Accordion title="Create spreadsheet">
    Creates a new **workbook** or may **duplicate** an existing one (`spreadsheets.create`).

    **Inputs:**

    * **title** (string) — Spreadsheet title.
    * **sheets** (optional, array) — Initial tabs with `title`.
    * **sourceSpreadsheetId** (optional, string) — If the tool supports duplicate-from-ID.

    **Example:**

    ```json theme={null}
    {
      "title": "Budget 2025",
      "sheets": [{ "title": "Jan" }, { "title": "Feb" }]
    }
    ```

    [Google documentation: `spreadsheets.create`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create)
  </Accordion>

  <Accordion title="Create Sheet">
    Creates a **new tab** in a workbook with a title (`AddSheetRequest` via `batchUpdate`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **title** (string) — New tab name.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "title": "Backup Q1"
    }
    ```

    [Google documentation: `AddSheetRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#AddSheetRequest) · [`batchUpdate`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate)
  </Accordion>

  <Accordion title="Delete conditional format rule">
    Deletes a conditional formatting rule by **index**.

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** (number) — Tab ID.
    * **index** (number) — Rule index to remove.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetId": 0,
      "index": 0
    }
    ```

    [Google documentation: `DeleteConditionalFormatRuleRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#DeleteConditionalFormatRuleRequest)
  </Accordion>

  <Accordion title="Delete rows">
    **Deletes** rows (`DeleteDimension` for rows).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** (number) — Tab.
    * **startIndex** (number) — First row (0-based).
    * **endIndex** (number) — End row (exclusive).

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetId": 0,
      "dimension": "ROWS",
      "startIndex": 5,
      "endIndex": 8
    }
    ```

    [Google documentation: `DeleteDimensionRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#deletedimensionrequest)
  </Accordion>

  <Accordion title="Delete sheet">
    Deletes a **tab** from the workbook (`DeleteSheetRequest`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** (number) — Tab ID to delete.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetId": 987654321
    }
    ```

    [Google documentation: `DeleteSheetRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#DeleteSheetRequest)
  </Accordion>

  <Accordion title="Find row">
    Finds one or more **rows** where a column matches a value (`values.get` + filter in the flow).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — Range to scan.
    * **column** (string or number) — Key column.
    * **value** (string) — Value to find.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Clients!A2:D",
      "column": "A",
      "value": "CLI-1001"
    }
    ```

    [Google documentation: `spreadsheets.values.get`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get)
  </Accordion>

  <Accordion title="Get cell">
    Gets a **cell value** (`values.get` on a one-cell range).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — Cell A1 (e.g. `Sheet1!B2`).

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Totals!E4"
    }
    ```

    [Google documentation: `spreadsheets.values.get`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get)
  </Accordion>

  <Accordion title="Get current user">
    Returns authenticated user metadata via Drive **`about.get`**: name, email, quota, etc.

    **Inputs:**

    * **fields** (optional, string) — Fields (`user`, `storageQuota`, …).

    **Example:**

    ```json theme={null}
    {
      "fields": "user,storageQuota"
    }
    ```

    [Google documentation: `about.get` (Drive)](https://developers.google.com/drive/api/v3/reference/about/get)
  </Accordion>

  <Accordion title="Get spreadsheet by ID">
    Returns the **spreadsheet resource**: tabs, properties (`spreadsheets.get`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **ranges** (optional, array of string) — Partial ranges if supported.
    * **includeGridData** (optional, boolean) — Include grid data.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "includeGridData": false
    }
    ```

    [Google documentation: `spreadsheets.get`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/get)
  </Accordion>

  <Accordion title="Get values in range">
    Reads **all values** in a range in A1 notation (`values.get`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — Range (e.g. `Sales!A1:F100`).
    * **majorDimension** (optional, enum: `ROWS` | `COLUMNS`) — Orientation.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Inventory!A2:E500",
      "majorDimension": "ROWS"
    }
    ```

    [Google documentation: `spreadsheets.values.get`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get)
  </Accordion>

  <Accordion title="Insert anchored note">
    Inserts a **cell note** (`batchUpdate` cell note requests).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** (number) — Tab.
    * **row** (number) — Row (0-based).
    * **column** (number) — Column (0-based).
    * **note** (string) — Note text.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetId": 0,
      "row": 3,
      "column": 1,
      "note": "Check with finance"
    }
    ```

    [Google documentation: `spreadsheets.batchUpdate`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate)
  </Accordion>

  <Accordion title="Insert comment">
    Inserts a **comment** on the file (Drive **comments** API for the spreadsheet file).

    **Inputs:**

    * **fileId** (string) — File ID (same as spreadsheetId).
    * **content** (string) — Comment body.
    * **anchor** (optional, object) — Anchor if exposed by the tool.

    **Example:**

    ```json theme={null}
    {
      "fileId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "content": "General comment on the template"
    }
    ```

    [Google documentation: `comments.create` (Drive)](https://developers.google.com/drive/api/v3/reference/comments/create)
  </Accordion>

  <Accordion title="Insert dimension">
    Inserts **rows or columns** (`InsertDimension`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** (number) — Tab.
    * **dimension** (enum: `ROWS` | `COLUMNS`) — Type.
    * **startIndex** / **endIndex** (number) — Position and span.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetId": 0,
      "dimension": "ROWS",
      "startIndex": 2,
      "endIndex": 3
    }
    ```

    [Google documentation: `InsertDimensionRequest`](https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/request#InsertDimensionRequest)
  </Accordion>

  <Accordion title="List worksheets">
    Lists **tabs** in a workbook (`spreadsheets.get` → `sheets[]`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz"
    }
    ```

    [Google documentation: `spreadsheets.get`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/get)
  </Accordion>

  <Accordion title="Merge cells">
    **Merges** a rectangular range (`MergeCells`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (object) — `sheetId`, `startRowIndex`, `endRowIndex`, `startColumnIndex`, `endColumnIndex`.
    * **mergeType** (optional, enum) — Merge type.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": {
        "sheetId": 0,
        "startRowIndex": 0,
        "endRowIndex": 1,
        "startColumnIndex": 0,
        "endColumnIndex": 4
      },
      "mergeType": "MERGE_ALL"
    }
    ```

    [Google documentation: `MergeCellsRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#MergeCellsRequest)
  </Accordion>

  <Accordion title="Move dimension">
    **Moves** a block of rows or columns (`MoveDimension`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** (number) — Tab.
    * **dimension** (enum: `ROWS` | `COLUMNS`) — Type.
    * **sourceIndex** / **destinationIndex** (number) — Source and destination per API.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetId": 0,
      "dimension": "ROWS",
      "sourceIndex": 10,
      "destinationIndex": 2
    }
    ```

    [Google documentation: `MoveDimensionRequest`](https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/request#MoveDimensionRequest)
  </Accordion>

  <Accordion title="Set data validation">
    Adds **data validation** (lists, numbers, dates, checkboxes) with `SetDataValidation`.

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (object) — Target range.
    * **rule** (object) — Rule (`condition`, `showCustomUi`, etc.).

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": { "sheetId": 0, "startRowIndex": 1, "endRowIndex": 100, "startColumnIndex": 2, "endColumnIndex": 3 },
      "rule": {
        "condition": { "type": "ONE_OF_LIST", "values": [{ "userEnteredValue": "Yes" }, { "userEnteredValue": "No" }] },
        "strict": true,
        "showCustomUi": true
      }
    }
    ```

    [Google documentation: `SetDataValidationRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#SetDataValidationRequest)
  </Accordion>

  <Accordion title="Update cell">
    Writes a **single cell** (`values.update` on a one-cell range).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — A1 cell.
    * **values** (2D array 1×1) — Value.
    * **valueInputOption** (optional, enum) — Default `USER_ENTERED`.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Control!B1",
      "values": [["Updated"]],
      "valueInputOption": "USER_ENTERED"
    }
    ```

    [Google documentation: `spreadsheets.values.update`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/update)
  </Accordion>

  <Accordion title="Update conditional format rule">
    Updates an existing conditional formatting rule (`UpdateConditionalFormatRule`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **sheetId** (number) — Tab.
    * **index** (number) — Rule index.
    * **rule** (object) — New definition.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "sheetId": 0,
      "index": 0,
      "rule": { "ranges": [], "booleanRule": {} }
    }
    ```

    [Google documentation: `UpdateConditionalFormatRuleRequest`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#UpdateConditionalFormatRuleRequest)
  </Accordion>

  <Accordion title="Update formatting">
    Updates **formatting** via `RepeatCell` / `UpdateCells` in `batchUpdate`.

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (object) — Range.
    * **format** (object) — `userEnteredFormat` (text, background, borders).

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": { "sheetId": 0, "startRowIndex": 0, "endRowIndex": 1, "startColumnIndex": 0, "endColumnIndex": 5 },
      "format": {
        "userEnteredFormat": {
          "textFormat": { "bold": true },
          "backgroundColor": { "red": 0.9, "green": 0.9, "blue": 0.9 }
        }
      }
    }
    ```

    [Google documentation: formatting samples](https://developers.google.com/workspace/sheets/api/samples/formatting)
  </Accordion>

  <Accordion title="Update multiple rows">
    Updates a **block of rows** with `values.update` on a rectangular range.

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — Range (e.g. `Sheet1!A2:D10`).
    * **values** (2D array) — Value matrix.
    * **valueInputOption** (optional, enum) — `USER_ENTERED`.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Data!A2:C5",
      "values": [["a", "b", "c"], ["d", "e", "f"]],
      "valueInputOption": "USER_ENTERED"
    }
    ```

    [Google documentation: `spreadsheets.values.update`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/update)
  </Accordion>

  <Accordion title="Update row">
    Updates **one row** (a single-row range).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — e.g. `Sheet1!A5:Z5`.
    * **values** (2D array with one row) — Values.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "Orders!A10:E10",
      "values": [["ORD-99", "Shipped", "2025-03-23", 0, "OK"]],
      "valueInputOption": "USER_ENTERED"
    }
    ```

    [Google documentation: `spreadsheets.values.update`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/update)
  </Accordion>

  <Accordion title="Insert or update row">
    **Inserts** a new row or **updates** if a key matches (upsert-style logic with `append` / `update`).

    **Inputs:**

    * **spreadsheetId** (string) — Spreadsheet ID.
    * **range** (string) — Table or range.
    * **values** (array) — Row values.
    * **keyColumn** (optional, string) — Key column for upsert.

    **Example:**

    ```json theme={null}
    {
      "spreadsheetId": "1AbCdEfGhIjKlMnOpQrStUvWxYz",
      "range": "CRM!A:D",
      "keyColumn": "A",
      "values": [["CLI-001", "Jane", "active", "2025-03-23"]]
    }
    ```

    [Google documentation: `spreadsheets.values.append`](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append)
  </Accordion>
</AccordionGroup>

***

## How to use in Brain

Once connected, you can use **Google Sheets** in two surfaces:

### In AI Agent

Ideal when users want to query, insert, or update rows in natural language.

<Steps>
  <Step title="Open the AI Agent node">
    In Canvas, select or add the **AI Agent** node.
  </Step>

  <Step title="Open Tools">
    In the right panel, open the **Tools** tab.
  </Step>

  <Step title="Add Google Sheets">
    Use **Add tool**, search for **Google Sheets**, and enable it.
  </Step>

  <Step title="Configure tools">
    Choose the full integration or enable only the actions you need. Adjust the prompt to confirm workbook, tab, and range before writing, and to ask for validation if an operation may overwrite data.

    <Check>
      **Google Sheets** appears in the agent tools list and you can open its settings using the gear icon.
    </Check>
  </Step>
</Steps>

The agent will automatically decide when to read or write in the workbook based on the conversation.

### In Canvas

Ideal when you need full flow control (for example: find row → validate → insert or update → next step).

<Steps>
  <Step title="Drag Google Sheets into Canvas">
    In the side panel, open **Marketplace** and drag **Google Sheets** into the flow.
  </Step>

  <Step title="Select the tool">
    With the node selected, in **Tools** choose the action (for example **Insert or update row**).
  </Step>

  <Step title="Configure request body and memory">
    Fill in the request body JSON and, if needed, **Save response** to a memory variable.
  </Step>

  <Step title="Connect the flow">
    Link the **Task completed** and **An error occurred** outputs to the next nodes.

    <Check>
      The node is ready to run in the order defined by your flow.
    </Check>
  </Step>
</Steps>

**Configuration example:**

The node editor shows a JSON body aligned with the **Insert or update row** tool. Adjust `spreadsheetId`, `range`, `keyColumn`, and `values` according to your workbook and columns.

```json theme={null}
{
  "spreadsheetId": "{{$memory.spreadsheet_id}}",
  "range": "Leads!A:D",
  "keyColumn": "A",
  "values": [["{{$memory.lead_id}}", "{{$memory.name}}", "{{$memory.status}}", "{{$memory.date}}"]]
}
```

***

## Use cases

<AccordionGroup>
  <Accordion title="Real-time lead logging from WhatsApp">
    Every sales interaction updates the sheet without anyone manually transcribing data.

    **Specific example:** an inbound sales team receives WhatsApp inquiries. The flow checks if the lead already exists by phone number. If not, it inserts a row with name, company, channel, and date. If it already exists, it updates the "last interaction" column. The sales team opens the sheet and sees all leads for the day, without duplicates or gaps.

    **Ideal for:** inbound sales, SDR teams, and agencies with high chat volume without a formal CRM.
  </Accordion>

  <Accordion title="Operational board with synchronized statuses">
    One row per customer with status columns updated from flows: appointment scheduled, payment confirmed, document sent. The team only acts on exceptions.

    **Specific example:** an implementation company uses a sheet with stage-status columns. When a flow schedules an appointment in Google Calendar, it updates the "Appointment" column to "Confirmed." When a document is sent via Gmail, it updates "Document" to "Sent." The manager opens the sheet and quickly sees who is blocked and who is progressing.

    **Ideal for:** operations, implementation, and services with SLAs that need visibility without building a complex dashboard.
  </Accordion>

  <Accordion title="Sheet as task queue across integrations">
    Sheets can work as an auditable queue where each row is a pending case. The flow reads rows with status "pending," executes actions in other integrations, and writes the result back.

    **Specific example:** a back-office company has a sheet with invoices to issue. Each row has customer, amount, and status. The flow reads pending rows, issues the invoice in Alegra or Facturama, and updates status to "Issued" with timestamp. Non-technical teams can review progress without touching automation.

    **Ideal for:** mid-market automation, back-office teams with several APIs, and teams that need auditable processes without infrastructure setup.
  </Accordion>
</AccordionGroup>

***

## Integrations that combine well with Google Sheets

<AccordionGroup>
  <Accordion title="Google Drive">
    When the flow uploads or generates a file in Drive, it can log `fileId`, link, and document status as columns in the operational sheet. Everything stays traceable in one place.

    **Combined flow:** file uploaded to Drive → new column in Sheets with link and date.

    [Google Drive documentation](/en/guides/integraciones/productividad/google-drive)
  </Accordion>

  <Accordion title="Gmail">
    Each relevant sent or received email can be logged as a row in Sheets: recipient, subject, date, and status. Useful as a communications log or commercial follow-up.

    **Combined flow:** email sent via Gmail → row in Sheets with recipient, subject, and timestamp.

    [Gmail documentation](/en/guides/integraciones/productividad/gmail)
  </Accordion>

  <Accordion title="Google Calendar">
    The flow can sync appointments with status columns in the sheet: scheduled, confirmed, canceled, or completed, with event date and time.

    **Combined flow:** event created in Google Calendar → "Appointment" column updated in Sheets with date and status.

    [Google Calendar documentation](/en/guides/integraciones/agendamiento/google-calendar)
  </Accordion>

  <Accordion title="CRM (HubSpot / Pipedrive)">
    For forecasting, prioritization, or leadership reviews, the flow can export pipeline stages, recent leads, or pending CRM tasks into a shared management spreadsheet.

    **Combined flow:** query active deals in HubSpot → update weekly forecast sheet in Sheets.

    [HubSpot documentation](/en/guides/integraciones/crm/hubspot)

    [Pipedrive documentation](/en/guides/integraciones/crm/pipedrive)
  </Accordion>
</AccordionGroup>

***

## Related articles

<CardGroup cols={2}>
  <Card title="Integrations" href="/en/guides/integraciones/integraciones" icon="grid">
    Catalog of integrations available in Marketplace.
  </Card>

  <Card title="How to use integrations in Brain" href="/en/guides/integraciones/como-usar-integraciones-en-brain" icon="book-open">
    General flow for installing and using integrations in Brain Studio.
  </Card>
</CardGroup>
