# SheetsBatchUpdateValuesTool

> **Class** in `langchain_google_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-community/sheets/write_sheet_tools/SheetsBatchUpdateValuesTool)

Tool for batch updating multiple ranges in Google Sheets efficiently.

Inherits from
[`SheetsBaseTool`][langchain_google_community.sheets.base.SheetsBaseTool].

Updates multiple ranges in a single API call, dramatically improving
efficiency.

## Signature

```python
SheetsBatchUpdateValuesTool()
```

## Description

**Tool Output:**

success (bool): Whether operation succeeded.
spreadsheet_id (str): The spreadsheet ID.
total_updated_ranges (int): Number of ranges updated.
total_updated_cells (int): Total cells updated across all ranges.
total_updated_rows (int): Total rows updated.
total_updated_columns (int): Total columns updated.
responses (list): Individual results for each range with `updated_range`
    and `updated_cells`.

???+ example "Basic Usage"

    Update multiple ranges in one call:

    ```python
    from langchain_google_community.sheets import SheetsBatchUpdateValuesTool

    tool = SheetsBatchUpdateValuesTool(api_resource=service)
    result = tool.run(
        {
            "spreadsheet_id": "1TI6vO9eGsAeXcfgEjoEYcu4RgSZCUF4vdWGLBpg9-fg",
            "data": [
                {
                    "range": "Sheet1!G1:G3",
                    "values": [["Status"], ["Active"], ["Active"]],
                },
                {"range": "Sheet1!H1:H3", "values": [["Country"], ["USA"]]},
                {"range": "Sheet1!I1:I3", "values": [["Dept"], ["Eng"]]},
            ],
        }
    )
    ```

??? example "Update Multiple Sheets"

    Update ranges across different sheets:

    ```python
    result = tool.run(
        {
            "spreadsheet_id": "1TI6vO9eGsAeXcfgEjoEYcu4RgSZCUF4vdWGLBpg9-fg",
            "data": [
                {
                    "range": "Sheet1!A1:A5",
                    "values": [["Data1"], ["Data2"], ["Data3"]],
                },
                {"range": "Sheet2!B1:B3", "values": [["Value1"], ["Value2"]]},
            ],
            "value_input_option": "USER_ENTERED",
        }
    )
    ```

## Extends

- `SheetsBaseTool`

## Properties

- `name`
- `description`
- `args_schema`

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/a3f016b2a6c4af535df275545f76fa7424aa39e5/libs/community/langchain_google_community/sheets/write_sheet_tools.py#L535)