Class DataSourceSheetFilter

  • DataSourceSheetFilter allows you to access and modify existing filters applied to data source sheets connected to databases.

  • You can get information about the filter, such as the column it applies to, the sheet it belongs to, and its criteria.

  • It provides methods to remove the filter and to set new filter criteria.

  • This class is exclusively for data connected to a database and is not intended for regular spreadsheet data.

  • All methods within DataSourceSheetFilter require authorization with specific scopes related to spreadsheet access.

DataSourceSheetFilter

Access and modify an existing data source sheet filter. To create a new data source sheet filter, use DataSourceSheet.addFilter(columnName, filterCriteria).

Only use this class with data that's connected to a database.

Methods

MethodReturn typeBrief description
getDataSourceColumn()DataSourceColumnReturns the data source column this filter applies to.
getDataSourceSheet()DataSourceSheetReturns the DataSourceSheet that this filter belongs to.
getFilterCriteria()FilterCriteriaReturns the filter criteria for this filter.
remove()voidRemoves this filter from the data source object.
setFilterCriteria(filterCriteria)DataSourceSheetFilterSets the filter criteria for this filter.

Detailed documentation

getDataSourceColumn()

Returns the data source column this filter applies to.

Return

DataSourceColumn — The data source column.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getDataSourceSheet()

Returns the DataSourceSheet that this filter belongs to.

Return

DataSourceSheet — The data source sheet, to which this filter belongs.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getFilterCriteria()

Returns the filter criteria for this filter.

Return

FilterCriteria — The filter criteria for this filter.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

remove()

Removes this filter from the data source object.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFilterCriteria(filterCriteria)

Sets the filter criteria for this filter.

Parameters

NameTypeDescription
filterCriteriaFilterCriteriaThe filter criteria to set.

Return

DataSourceSheetFilter — The filter for chaining.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets