Class DataSourceSheetFilter
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
OrigineDatiFoglioFiltro
Accedere a un filtro del foglio dell'origine dati esistente e modificarlo. Per creare un nuovo filtro dei fogli delle origini dati,
utilizza DataSourceSheet.addFilter(columnName, filterCriteria)
.
Utilizza questa classe solo con dati collegati a un database.
Documentazione dettagliata
getDataSourceColumn()
Restituisce la colonna dell'origine dati a cui si applica questo filtro.
Invio
DataSourceColumn
: la colonna dell'origine dati.
Autorizzazione
Gli script che utilizzano questo metodo richiedono l'autorizzazione con uno o più dei seguenti ambiti:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getDataSourceSheet()
Restituisce il DataSourceSheet
a cui appartiene questo filtro.
Invio
DataSourceSheet
: il foglio dell'origine dati a cui appartiene questo filtro.
Autorizzazione
Gli script che utilizzano questo metodo richiedono l'autorizzazione con uno o più dei seguenti ambiti:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFilterCriteria()
Restituisce i criteri di filtro per questo filtro.
Invio
FilterCriteria
: i criteri di filtro per questo filtro.
Autorizzazione
Gli script che utilizzano questo metodo richiedono l'autorizzazione con uno o più dei seguenti ambiti:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
remove()
Rimuove questo filtro dall'oggetto origine dati.
Autorizzazione
Gli script che utilizzano questo metodo richiedono l'autorizzazione con uno o più dei seguenti ambiti:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFilterCriteria(filterCriteria)
Imposta i criteri di filtro per questo filtro.
Parametri
Nome | Tipo | Descrizione |
filterCriteria | FilterCriteria | I criteri di filtro da impostare. |
Invio
DataSourceSheetFilter
: il filtro per l'accodamento.
Autorizzazione
Gli script che utilizzano questo metodo richiedono l'autorizzazione con uno o più dei seguenti ambiti:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eDataSourceSheetFilter\u003c/code\u003e allows you to access and modify existing filters applied to data source sheets connected to databases.\u003c/p\u003e\n"],["\u003cp\u003eYou can get information about the filter, such as the column it applies to, the sheet it belongs to, and its criteria.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to remove the filter and to set new filter criteria.\u003c/p\u003e\n"],["\u003cp\u003eThis class is exclusively for data connected to a database and is not intended for regular spreadsheet data.\u003c/p\u003e\n"],["\u003cp\u003eAll methods within \u003ccode\u003eDataSourceSheetFilter\u003c/code\u003e require authorization with specific scopes related to spreadsheet access.\u003c/p\u003e\n"]]],["`DataSourceSheetFilter` allows interaction with existing filters on database-connected data. Key actions include: retrieving the associated data source column, sheet, and filter criteria using `getDataSourceColumn()`, `getDataSourceSheet()`, and `getFilterCriteria()`, respectively. Filters can be removed with `remove()` or modified using `setFilterCriteria()`. Creating new filters requires `DataSourceSheet.addFilter`. All methods necessitate specific authorization scopes related to spreadsheets.\n"],null,["# Class DataSourceSheetFilter\n\nDataSourceSheetFilter\n\nAccess and modify an existing data source sheet filter. To create a new data source sheet filter,\nuse [DataSourceSheet.addFilter(columnName, filterCriteria)](/apps-script/reference/spreadsheet/data-source-sheet#addFilter(String,FilterCriteria)).\n\n\n**Only use this class with data that's connected to a database.** \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------------------------------|---------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| [getDataSourceColumn()](#getDataSourceColumn()) | [DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) | Returns the data source column this filter applies to. |\n| [getDataSourceSheet()](#getDataSourceSheet()) | [DataSourceSheet](/apps-script/reference/spreadsheet/data-source-sheet) | Returns the [DataSourceSheet](/apps-script/reference/spreadsheet/data-source-sheet) that this filter belongs to. |\n| [getFilterCriteria()](#getFilterCriteria()) | [FilterCriteria](/apps-script/reference/spreadsheet/filter-criteria) | Returns the filter criteria for this filter. |\n| [remove()](#remove()) | `void` | Removes this filter from the data source object. |\n| [setFilterCriteria(filterCriteria)](#setFilterCriteria(FilterCriteria)) | [DataSourceSheetFilter](#) | Sets the filter criteria for this filter. |\n\nDetailed documentation\n----------------------\n\n### `get``Data``Source``Column()`\n\nReturns the data source column this filter applies to.\n\n#### Return\n\n\n[DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) --- The data source column.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Data``Source``Sheet()`\n\nReturns the [DataSourceSheet](/apps-script/reference/spreadsheet/data-source-sheet) that this filter belongs to.\n\n#### Return\n\n\n[DataSourceSheet](/apps-script/reference/spreadsheet/data-source-sheet) --- The data source sheet, to which this filter belongs.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Filter``Criteria()`\n\nReturns the filter criteria for this filter.\n\n#### Return\n\n\n[FilterCriteria](/apps-script/reference/spreadsheet/filter-criteria) --- The filter criteria for this filter.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `remove()`\n\nRemoves this filter from the data source object.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `set``Filter``Criteria(filterCriteria)`\n\nSets the filter criteria for this filter.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------------------|----------------------------------------------------------------------|-----------------------------|\n| `filter``Criteria` | [FilterCriteria](/apps-script/reference/spreadsheet/filter-criteria) | The filter criteria to set. |\n\n#### Return\n\n\n[DataSourceSheetFilter](#) --- The filter for chaining.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`"]]