Write to a range in a Google Sheet
update_sheetCorrect existing cell values in Google Sheets by overwriting an exact range; refuses to overwrite filled cells unless confirmed, then reads back the updated data.
Instructions
CORRECT cells in a Google Sheet — write values to an exact range, overwriting whatever is there. This is the fix append_to_sheet cannot make: appending only ever adds rows at the bottom, so without this a wrong number stays wrong forever and the only "correction" is a second row contradicting the first. Pass range (e.g. "B2:C5", or "Q3 Report!B2" to name a tab — list_sheet_tabs gives the names) and values as an array of row arrays; an anchor cell like "B2" is fine and the block is written down and right from it. Writing into EMPTY cells goes straight through. Writing OVER cells that already hold values is REFUSED first, naming exactly how many filled cells would be overwritten — show the user that, get a yes, then call again with confirm:true. The result is READ BACK from the sheet, so what you report is what the sheet now holds rather than what Google accepted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | A1 range or anchor cell, e.g. "B2:C5", "B2", or "Q3 Report!B2" (default A1) | |
| values | No | array of row arrays to write | |
| confirm | No | required only when the target range already holds values | |
| updates | No | write SEVERAL disjoint ranges in one call, instead of range+values | |
| sheetUrl | No | ||
| spreadsheetId | No | ||
| valueInputOption | No | USER_ENTERED (default) parses formulas, dates and numbers the way typing them would; RAW stores every value as literal text |