Batch Get

Returns one or more ranges of values from a spreadsheet

5 variables
5 variables

Returns one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges

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
  • See and download all your Google Drive files
  • View and manage your spreadsheets in Google Drive
  • View your Google Spreadsheets

Input

This building block consumes 5 input parameters

  = Parameter name
  = Format

spreadsheetId STRING Required

The ID of the spreadsheet to retrieve data from

valueRenderOption ENUMERATION

How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE

dateTimeRenderOption ENUMERATION

How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]

ranges STRING

The A1 notation of the values to retrieve

majorDimension ENUMERATION

The major dimension that results should use.

For example, 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]]

Output

This building block provides 5 output parameters

  = Parameter name
  = Format

valueRanges[] OBJECT

Data within a range of the spreadsheet

valueRanges[].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

valueRanges[].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

valueRanges[].values[] OBJECT_ARRAY

spreadsheetId STRING

The ID of the spreadsheet the data was retrieved from