Batch Update Spreadsheet
sheets_batch_updateApply batch updates to Google Spreadsheets, including formatting, charts, filters, and conditional formatting rules, using a single API request.
Instructions
Apply batch updates to a Google Spreadsheet (formatting, charts, filters, conditional formatting, etc.).
Args:
spreadsheet_id (string): The ID of the Google Spreadsheet to update
requests (array): Array of batch update request objects
Common request types:
updateCells: Update cell data and formatting
addSheet: Add a new sheet
deleteSheet: Delete a sheet
updateSheetProperties: Rename sheet, change grid size
mergeCells: Merge cell ranges
addConditionalFormatRule: Add conditional formatting
addChart: Add a chart
setDataValidation: Add data validation rules
addFilterView: Add filter views
repeatCell: Apply formatting to a range
See Google Sheets API batchUpdate documentation for full request schema.
Returns: { "spreadsheetId": string, "replies": array }
Examples:
Add sheet: requests=[{ "addSheet": { "properties": { "title": "NewSheet" } } }]
Bold range: requests=[{ "repeatCell": { "range": {...}, "cell": { "userEnteredFormat": { "textFormat": { "bold": true } } }, "fields": "userEnteredFormat.textFormat.bold" } }]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spreadsheet_id | Yes | The ID of the Google Spreadsheet to update | |
| requests | Yes | Array of batch update request objects (see Google Sheets API batchUpdate documentation) |