A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/apps-script/reference/spreadsheet/slicer below:

Class Slicer | Apps Script

Skip to main content Class Slicer

Stay organized with collections Save and categorize content based on your preferences.

Methods Deprecated methods Method Return type Brief description getBackgroundColor() String Returns the background color of the slicer in CSS notation (such as '#ffffff'). Detailed documentation getBackgroundColorObject()

Return the background Color of the slicer.

Return

Color — The background color of this slicer. Returns null if no color is set.

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

getColumnPosition()

Returns the column position (relative to the data range of the slicer) on which the filter is applied in the slicer, or null if the column position is not set. This should be 1-indexed position of the column similar to filter.

Return

Integer — The column position of this slicer.

Authorization

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

getContainerInfo()

Gets information about where the slicer is positioned in the sheet.

Return

ContainerInfo — An object containing the slicer's container position.

Authorization

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

getFilterCriteria()

Returns the filter criteria of the slicer, or null if the filter criteria is not set.

Return

FilterCriteria — The filter criteria of this slicer.

Authorization

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

getRange()

Gets the data range on which the slicer is applied to.

Return

Range — The slicer range.

Authorization

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

getTitle()

Returns the title of the slicer.

Return

String — This slicer, for chaining.

Authorization

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

getTitleHorizontalAlignment()

Gets the horizontal alignment of the title.

Return

String — The horizontal alignment of this slicer's title.

Authorization

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

getTitleTextStyle()

Returns the text style of the slicer's title.

Return

TextStyle — The text style of this slicer's title.

Authorization

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

isAppliedToPivotTables()

Returns whether the given slicer is applied to pivot tables.

Return

Booleantrue if this slicer is applied to pivot tables, otherwise false.

Authorization

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

remove()

Deletes the slicer.

Authorization

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

setApplyToPivotTables(applyToPivotTables)

Sets if the given slicer should be applied to pivot tables in the worksheet.

Parameters Name Type Description applyToPivotTables Boolean Specifies whether this slicer should apply to pivot tables. Return

Slicer — This slicer, for chaining.

Authorization

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

setBackgroundColor(color)

Sets the background color of the slicer. A null value resets the background color.

Parameters Name Type Description color String The new background color of this slicer in CSS notation (such as '#ffffff'). Return

Slicer — This slicer, for chaining.

Authorization

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

setBackgroundColorObject(color)

Sets the background Color of the slicer. A null value resets the background color.

Parameters Name Type Description color Color The new background color of this slicer. Return

Slicer — This slicer, for chaining.

Authorization

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

setColumnFilterCriteria(columnPosition, filterCriteria)

Sets the column index and filtering criteria of the slicer. A null value resets the slicer filter.

Parameters Name Type Description columnPosition Integer The new column position of this slicer. filterCriteria FilterCriteria The new filter criteria of this slicer. Return

Slicer — This slicer, for chaining.

Authorization

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

setPosition(anchorRowPos, anchorColPos, offsetX, offsetY)

Sets the position where the slicer appears on the sheet. The anchor row and column position indices are 1-indexed.

Parameters Name Type Description anchorRowPos Integer The slicer's top side is anchored in this row. anchorColPos Integer The slicer's top side is anchored in this col. offsetX Integer The horizontal offset from cell corner in pixels. offsetY Integer The vertical offset from cell corner in pixels. Return

Slicer — This slicer, for chaining.

Authorization

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

setRange(rangeApi)

Sets the data range on which the slicer is applied.

Parameters Name Type Description rangeApi Range The new range for this slicer. Return

Slicer — This slicer, for chaining.

Authorization

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

setTitle(title)

Sets the title of the slicer. An empty title resets the title to default value.

Parameters Name Type Description title String The new title of this slicer. Return

Slicer — This slicer, for chaining.

Authorization

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

setTitleHorizontalAlignment(horizontalAlignment)

Sets the horizontal alignment of the title in the slicer. A null value resets the alignment.

Parameters Name Type Description horizontalAlignment String The new horizontal alignment of this slicer's title. Return

Slicer — This slicer, for chaining.

Authorization

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

setTitleTextStyle(textStyle)

Sets the text style of the slicer.

Parameters Name Type Description textStyle TextStyle The new text style of the slicer's title. Return

Slicer — This slicer, for chaining.

Authorization

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

Deprecated methods getBackgroundColor()

Deprecated. Replaced by getBackgroundColorObject()

Returns the background color of the slicer in CSS notation (such as '#ffffff').

Return

String — The background color of this slicer. Returns null if no color is set.

Authorization

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

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-12-03 UTC.

[[["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 2024-12-03 UTC."],[[["The `Slicer` class allows you to programmatically control slicers in Google Sheets, enabling you to filter data in ranges, charts, and pivot tables without collaboration."],["You can access and modify existing slicers or create new ones using the provided methods, such as setting the data range, background color, title, and position."],["The `Slicer` class offers various methods for customizing the slicer's appearance, including setting the background color, title alignment, and text style."],["To use the `Slicer` class effectively, you will need to authorize your script with the necessary scopes to access and modify spreadsheet data."],["Several methods are available for interacting with the slicer's filter criteria, allowing you to retrieve, set, and manipulate the filtering conditions applied to the data."]]],["Slicers filter ranges, charts, and pivot tables. Key actions include: retrieving and modifying slicer properties like background color, column position, filter criteria, data range, and title. Slicers can be positioned and have their applicability to pivot tables set. You can also manage the title's horizontal alignment and text style. Slicers are created using `Sheet.insertSlicer`. The method to remove a slicer is `remove()`. The old method to obtain background colors is deprecated and should be replaced by `getBackgroundColorObject()`.\n"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4