younifyd
Menu

Sheets.spreadsheets.values.batch Get

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

GET/v4/spreadsheets/{spreadsheetId}/values:batchGet

Use it in a workflow

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

Request

Path parameters

spreadsheetIdstringrequired

The ID of the spreadsheet to retrieve data from.

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").

dateTimeRenderOptionstring

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

One ofSERIAL_NUMBERFORMATTED_STRING

majorDimensionstring

The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `ranges=["A1:B2"],majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas requesting `ranges=["A1:B2"],majorDimension=COLUMNS` returns `[[1,3],[2,4]]`.

One ofDIMENSION_UNSPECIFIEDROWSCOLUMNS

rangesarray<string>

The [A1 notation or R1C1 notation](/sheets/api/guides/concepts#cell) of the range to retrieve values from.

valueRenderOptionstring

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

One ofFORMATTED_VALUEUNFORMATTED_VALUEFORMULA

Response

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

spreadsheetIdstring

The ID of the spreadsheet the data was retrieved from.

valueRangesarray<object>

The requested values. The order of the ValueRanges is the same as the order of the requested ranges.

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.

json
{
  "spreadsheetId": "string",
  "valueRanges": [
    {
      "majorDimension": "DIMENSION_UNSPECIFIED",
      "range": "string",
      "values": [
        [
          null
        ]
      ]
    }
  ]
}

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