Batch Update

Sets values in one or more ranges of a spreadsheet

9 variables
15 variables

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

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • See, edit, create, and delete all of your Google Drive files
  • View and manage Google Drive files and folders that you have opened or created with this app
  • View and manage your spreadsheets in Google Drive

Input

This building block consumes 9 input parameters

  = Parameter name
  = Format

spreadsheetId STRING Required

The ID of the spreadsheet to update

responseDateTimeRenderOption ENUMERATION

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 DateTimeRenderOption.SERIAL_NUMBER

responseValueRenderOption ENUMERATION

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

includeValuesInResponse BOOLEAN

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 will contain the updated values. If the range to write was larger than than the range actually written, the response will include all values in the requested range (excluding trailing empty rows and columns)

valueInputOption ENUMERATION

How the input data should be interpreted

data[] OBJECT

Data within a range of the spreadsheet

data[].range STRING

The range the values cover, in A1 notation. 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

data[].majorDimension ENUMERATION

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

data[].values[] OBJECT_ARRAY

Output

This building block provides 15 output parameters

  = Parameter name
  = Format

totalUpdatedCells INTEGER

The total number of cells updated

totalUpdatedColumns INTEGER

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

spreadsheetId STRING

The spreadsheet the updates were applied to

totalUpdatedRows INTEGER

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

responses[] OBJECT

The response when updating a range of values in a spreadsheet

responses[].updatedRows INTEGER

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

responses[].updatedData OBJECT

Data within a range of the spreadsheet

responses[].updatedData.range STRING

The range the values cover, in A1 notation. 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

responses[].updatedData.majorDimension ENUMERATION

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

responses[].updatedData.values[] OBJECT_ARRAY

responses[].updatedColumns INTEGER

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

responses[].spreadsheetId STRING

The spreadsheet the updates were applied to

responses[].updatedRange STRING

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

responses[].updatedCells INTEGER

The number of cells updated

totalUpdatedSheets INTEGER

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