younifyd
Menu

Sheets.spreadsheets.values.batch Update

Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.

POST/v4/spreadsheets/{spreadsheetId}/values:batchUpdate

Use it in a workflow

  1. Add a step and choose the Google Sheets connector.
  2. Pick the Sheets.spreadsheets.values.batch Update action (under spreadsheets).
  3. Fill in the fields below, then reference the result from later steps as {{sheetsSpreadsheetsValuesBatchUpdate.response.data}}.

Request

Path parameters

spreadsheetIdstringrequired

The ID of the spreadsheet to update.

Query parameters

$.xgafvstring

V1 error format.

One of12

access_tokenstring

OAuth access token.

altstring

Data format for response.

One ofjsonmediaproto

callbackstring

JSONP

fieldsstring

Selector specifying which fields to include in a partial response.

keystring

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_tokenstring

OAuth 2.0 token for the current user.

prettyPrintboolean

Returns response with indentations and line breaks.

quotaUserstring

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

upload_protocolstring

Upload protocol for media (e.g. "raw", "multipart").

uploadTypestring

Legacy upload protocol for media (e.g. "media", "multipart").

Request body

Enter the body as JSON in the step's Body field.

dataarray<object>

The new values to apply to the spreadsheet.

majorDimensionstring

The major dimension of the values. For output, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. For input, with `range=A1:B2,majorDimension=ROWS` then `[[1,2],[3,4]]` will set `A1=1,B1=2,A2=3,B2=4`. With `range=A1:B2,majorDimension=COLUMNS` then `[[1,2],[3,4]]` will set `A1=1,B1=3,A2=2,B2=4`. When writing, if this field is not set, it defaults to ROWS.

One ofDIMENSION_UNSPECIFIEDROWSCOLUMNS

rangestring

The range the values cover, in [A1 notation](/sheets/api/guides/concepts#cell). For output, this range indicates the entire requested range, even though the values will exclude trailing rows and columns. When appending values, this field represents the range to search for a table, after which values will be appended.

valuesarray<array<any>>

The data that was read or to be written. This is an array of arrays, the outer array representing all the data and each inner array representing a major dimension. Each item in the inner array corresponds with one cell. For output, empty trailing rows and columns will not be included. For input, supported value types are: bool, string, and double. Null values will be skipped. To set a cell to an empty value, set the string value to an empty string.

includeValuesInResponseboolean

Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. The `updatedData` field within each of the BatchUpdateValuesResponse.responses contains the updated values. If the range to write was larger than the range actually written, the response includes all values in the requested range (excluding trailing empty rows and columns).

responseDateTimeRenderOptionstring

Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.

One ofSERIAL_NUMBERFORMATTED_STRING

responseValueRenderOptionstring

Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.

One ofFORMATTED_VALUEUNFORMATTED_VALUEFORMULA

valueInputOptionstring

How the input data should be interpreted.

One ofINPUT_VALUE_OPTION_UNSPECIFIEDRAWUSER_ENTERED

json
{
  "data": [
    {
      "majorDimension": "DIMENSION_UNSPECIFIED",
      "range": "string",
      "values": [
        [
          null
        ]
      ]
    }
  ],
  "includeValuesInResponse": false,
  "responseDateTimeRenderOption": "SERIAL_NUMBER",
  "responseValueRenderOption": "FORMATTED_VALUE",
  "valueInputOption": "INPUT_VALUE_OPTION_UNSPECIFIED"
}

Response

Returns 200 with an object. Read it in later steps with {{sheetsSpreadsheetsValuesBatchUpdate.response.data.<field>}}.

responsesarray<object>

One UpdateValuesResponse per requested range, in the same order as the requests appeared.

spreadsheetIdstring

The spreadsheet the updates were applied to.

updatedCellsinteger (int32)

The number of cells updated.

updatedColumnsinteger (int32)

The number of columns where at least one cell in the column was updated.

updatedDataobject3 fields

Data within a range of the spreadsheet.

updatedRangestring

The range (in A1 notation) that updates were applied to.

updatedRowsinteger (int32)

The number of rows where at least one cell in the row was updated.

spreadsheetIdstring

The spreadsheet the updates were applied to.

totalUpdatedCellsinteger (int32)

The total number of cells updated.

totalUpdatedColumnsinteger (int32)

The total number of columns where at least one cell in the column was updated.

totalUpdatedRowsinteger (int32)

The total number of rows where at least one cell in the row was updated.

totalUpdatedSheetsinteger (int32)

The total number of sheets where at least one cell in the sheet was updated.

json
{
  "responses": [
    {
      "spreadsheetId": "string",
      "updatedCells": 0,
      "updatedColumns": 0,
      "updatedData": {
        "majorDimension": "DIMENSION_UNSPECIFIED",
        "range": "string",
        "values": [
          [
            null
          ]
        ]
      },
      "updatedRange": "string",
      "updatedRows": 0
    }
  ],
  "spreadsheetId": "string",
  "totalUpdatedCells": 0,
  "totalUpdatedColumns": 0,
  "totalUpdatedRows": 0,
  "totalUpdatedSheets": 0
}

Need more? See the Google Sheets guide for connection setup and behaviour shared by every action.

Sheets.spreadsheets.values.batch Update — Google Sheets — Documentation