Class SortSpec  |  Apps Script  |  Google for Developers (original) (raw)

Class SortSpec

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

SortSpec

The sorting specification.

Methods

Method Return type Brief description
getBackgroundColor() Color Returns the background color used for sorting, or null if absent.
getDataSourceColumn() DataSourceColumn Gets the data source column the sort spec acts on.
getDimensionIndex() Integer Returns the dimension index or null if not linked to a local filter.
getForegroundColor() Color Returns the foreground color used for sorting, or null if absent.
getSortOrder() SortOrder Returns the sort order.
isAscending() Boolean Returns whether the sort order is ascending.

Detailed documentation

getBackgroundColor()

Returns the background color used for sorting, or null if absent.

Return

[Color](/apps-script/reference/spreadsheet/color) — The background color.

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


getDataSourceColumn()

Gets the data source column the sort spec acts on. Returns null if this sort spec is not acting on a data source column.

Return

[DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) — The data source column the sort spec acts on.

Authorization

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


getDimensionIndex()

Returns the dimension index or null if not linked to a local filter.

Return

Integer — The dimension index.

Authorization

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


getForegroundColor()

Returns the foreground color used for sorting, or null if absent.

Return

[Color](/apps-script/reference/spreadsheet/color) — The foreground color.

Authorization

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


getSortOrder()

Returns the sort order.

Return

[SortOrder](/apps-script/reference/spreadsheet/sort-order) — The sort order.

Authorization

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


isAscending()

Returns whether the sort order is ascending.

Return

Booleantrue if the sort order is ascending, or false otherwise.

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-02 UTC.