Returns one or more ranges of values that match the specified data filters. The caller must specify the spreadsheet ID and one or more DataFilters. Ranges that match any of the data filters in the request will be returned.
HTTP request
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter
For example, if the spreadsheet data is: A1=1,B1=2,A2=3,B2=4, then a request that selects that range and sets majorDimension=ROWS returns [[1,2],[3,4]], whereas a request that sets majorDimension=COLUMNS returns [[1,3],[2,4]].
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 UTC."],[],[],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.BatchGetValuesByDataFilterResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [MatchedValueRange](#MatchedValueRange)\n - [JSON representation](#MatchedValueRange.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nReturns one or more ranges of values that match the specified data filters. The caller must specify the spreadsheet ID and one or more [DataFilters](/workspace/sheets/api/reference/rest/v4/DataFilter). Ranges that match any of the data filters in the request will be returned.\n\nHTTP request\n\n`POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|-----------------|-----------------------------------------------------------|\n| `spreadsheetId` | `string` The ID of the spreadsheet to retrieve data from. |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"dataFilters\": [ { object (/workspace/sheets/api/reference/rest/v4/DataFilter) } ], \"majorDimension\": enum (/workspace/sheets/api/reference/rest/v4/Dimension), \"valueRenderOption\": enum (/workspace/sheets/api/reference/rest/v4/ValueRenderOption), \"dateTimeRenderOption\": enum (/workspace/sheets/api/reference/rest/v4/DateTimeRenderOption) } ``` |\n\n| Fields ||\n|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dataFilters[]` | `object (`[DataFilter](/workspace/sheets/api/reference/rest/v4/DataFilter)`)` The data filters used to match the ranges of values to retrieve. Ranges that match any of the specified data filters are included in the response. |\n| `majorDimension` | `enum (`[Dimension](/workspace/sheets/api/reference/rest/v4/Dimension)`)` The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then a request that selects that range and sets `majorDimension=ROWS` returns `[[1,2],[3,4]]`, whereas a request that sets `majorDimension=COLUMNS` returns `[[1,3],[2,4]]`. |\n| `valueRenderOption` | `enum (`[ValueRenderOption](/workspace/sheets/api/reference/rest/v4/ValueRenderOption)`)` How values should be represented in the output. The default render option is [FORMATTED_VALUE](/workspace/sheets/api/reference/rest/v4/ValueRenderOption). |\n| `dateTimeRenderOption` | `enum (`[DateTimeRenderOption](/workspace/sheets/api/reference/rest/v4/DateTimeRenderOption)`)` How dates, times, and durations should be represented in the output. This is ignored if [valueRenderOption](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGetByDataFilter#body.request_body.FIELDS.value_render_option) is [FORMATTED_VALUE](/workspace/sheets/api/reference/rest/v4/ValueRenderOption). The default dateTime render option is [SERIAL_NUMBER](/workspace/sheets/api/reference/rest/v4/DateTimeRenderOption). |\n\nResponse body The response when retrieving more than one range of values in a spreadsheet selected by [DataFilters](/workspace/sheets/api/reference/rest/v4/DataFilter).\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"spreadsheetId\": string, \"valueRanges\": [ { object (/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGetByDataFilter#MatchedValueRange) } ] } ``` |\n\n| Fields ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `spreadsheetId` | `string` The ID of the spreadsheet the data was retrieved from. |\n| `valueRanges[]` | `object (`[MatchedValueRange](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGetByDataFilter#MatchedValueRange)`)` The requested values with the list of data filters that matched them. |\n\nAuthorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive`\n- `https://www.googleapis.com/auth/drive.file`\n- `https://www.googleapis.com/auth/spreadsheets`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nMatchedValueRange A value range that was matched by one or more data filers.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"valueRange\": { object (/workspace/sheets/api/reference/rest/v4/spreadsheets.values#ValueRange) }, \"dataFilters\": [ { object (/workspace/sheets/api/reference/rest/v4/DataFilter) } ] } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `valueRange` | `object (`[ValueRange](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#ValueRange)`)` The values matched by the [DataFilter](/workspace/sheets/api/reference/rest/v4/DataFilter). |\n| `dataFilters[]` | `object (`[DataFilter](/workspace/sheets/api/reference/rest/v4/DataFilter)`)` The [DataFilters](/workspace/sheets/api/reference/rest/v4/DataFilter) from the request that matched the range of values. |"]]