# SheetsUpdateValuesTool

> **Class** in `langchain_google_community`

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

Tool for updating values in a single range of Google Sheets.

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

Updates cell values in a specified range, overwriting existing data.

!!! note "Authentication Required"

    Requires OAuth2 authentication. Use `api_resource` parameter with
    authenticated Google Sheets service.

## Signature

```python
SheetsUpdateValuesTool()
```

## Description

**Tool Output:**

success (bool): Whether operation succeeded.
spreadsheet_id (str): The spreadsheet ID.
updated_range (str): The A1 notation of updated range.
updated_rows (int): Number of rows updated.
updated_columns (int): Number of columns updated.
updated_cells (int): Total number of cells updated.

???+ example "Basic Usage"

    Update a range with data:

    ```python
    from langchain_google_community.sheets import SheetsUpdateValuesTool

    tool = SheetsUpdateValuesTool(api_resource=service)
    result = tool.run(
        {
            "spreadsheet_id": "1TI6vO9eGsAeXcfgEjoEYcu4RgSZCUF4vdWGLBpg9-fg",
            "range": "Sheet1!A1:C3",
            "values": [
                ["Name", "Age", "City"],
                ["Alice", "25", "New York"],
                ["Bob", "30", "San Francisco"],
            ],
        }
    )
    ```

??? example "With Formulas"

    Update cells with formulas using `USER_ENTERED`:

    ```python
    result = tool.run(
        {
            "spreadsheet_id": "1TI6vO9eGsAeXcfgEjoEYcu4RgSZCUF4vdWGLBpg9-fg",
            "range": "Sheet1!D2:D3",
            "values": [["=SUM(B2:C2)"], ["=SUM(B3:C3)"]],
            "value_input_option": "USER_ENTERED",
        }
    )
    ```

## Extends

- `SheetsBaseTool`

## Properties

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

---

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