Class DataSourceTableFilter
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
DatenQuelleTabelleFilter
Auf einen vorhandenen Datenquellentabellenfilter zugreifen und ihn ändern Verwenden Sie DataSourceTable.addFilter(columnName, filterCriteria)
, um einen neuen Tabellenfilter für die Datenquelle zu erstellen.
Verwenden Sie diese Klasse nur mit Daten, die mit einer Datenbank verbunden sind.
Detaillierte Dokumentation
getDataSourceColumn()
Gibt die Datenquellenspalte zurück, auf die dieser Filter angewendet wird.
Rückflug
DataSourceColumn
: Die Datenquellenspalte.
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getDataSourceTable()
Gibt die DataSourceTable
zurück, zu der dieser Filter gehört.
Rückflug
DataSourceTable
: Die Datenquellentabelle, zu der dieser Filter gehört.
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFilterCriteria()
Gibt die Filterkriterien für diesen Filter zurück.
Rückflug
FilterCriteria
: Die Filterkriterien für diesen Filter.
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
remove()
Entfernt diesen Filter aus dem Datenquellenobjekt.
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFilterCriteria(filterCriteria)
Hier legen Sie die Filterkriterien für diesen Filter fest.
Parameter
Name | Typ | Beschreibung |
filterCriteria | FilterCriteria | Die Filterkriterien, die festgelegt werden sollen. |
Rückflug
DataSourceTableFilter
: Der Filter für die Verkettung.
Autorisierung
Scripts, die diese Methode verwenden, erfordern eine Autorisierung für einen oder mehrere der folgenden Bereiche:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eDataSourceTableFilter\u003c/code\u003e allows you to access and modify existing filters applied to data source tables connected to a database.\u003c/p\u003e\n"],["\u003cp\u003eYou can get information about the filter, such as the column it applies to, the table it belongs to, and its criteria, using methods like \u003ccode\u003egetDataSourceColumn()\u003c/code\u003e, \u003ccode\u003egetDataSourceTable()\u003c/code\u003e, and \u003ccode\u003egetFilterCriteria()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eModify or delete a filter by utilizing the \u003ccode\u003esetFilterCriteria()\u003c/code\u003e and \u003ccode\u003eremove()\u003c/code\u003e methods respectively.\u003c/p\u003e\n"],["\u003cp\u003eAll methods within \u003ccode\u003eDataSourceTableFilter\u003c/code\u003e necessitate authorization with specific scopes related to spreadsheet access.\u003c/p\u003e\n"]]],[],null,["# Class DataSourceTableFilter\n\nDataSourceTableFilter\n\nAccess and modify an existing data source table filter. To create a new data source table filter,\nuse [DataSourceTable.addFilter(columnName, filterCriteria)](/apps-script/reference/spreadsheet/data-source-table#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| [getDataSourceTable()](#getDataSourceTable()) | [DataSourceTable](/apps-script/reference/spreadsheet/data-source-table) | Returns the [DataSourceTable](/apps-script/reference/spreadsheet/data-source-table) 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)) | [DataSourceTableFilter](#) | 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``Table()`\n\nReturns the [DataSourceTable](/apps-script/reference/spreadsheet/data-source-table) that this filter belongs to.\n\n#### Return\n\n\n[DataSourceTable](/apps-script/reference/spreadsheet/data-source-table) --- The data source table, 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[DataSourceTableFilter](#) --- 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`"]]