Obtiene la columna de la fuente de datos en la que actúa la especificación de clasificación. Muestra null si esta especificación de orden no actúa en una columna de fuente de datos.
Volver
DataSourceColumn: Es la columna de la fuente de datos en la que actúa la especificación de clasificación.
Autorización
Las secuencias de comandos que usan este método requieren autorización con uno o más de los siguientes ámbitos:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-07-26 (UTC)"],[[["\u003cp\u003e\u003ccode\u003eSortSpec\u003c/code\u003e defines the specifications for sorting data, such as sort order, colors, and the data source.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to retrieve information about the sort specification, including background and foreground colors, sort order, and the data source column being used.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine if the sort order is ascending using the \u003ccode\u003eisAscending()\u003c/code\u003e method and obtain the dimension index with \u003ccode\u003egetDimensionIndex()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAll methods within \u003ccode\u003eSortSpec\u003c/code\u003e require authorization with specific scopes related to spreadsheet access.\u003c/p\u003e\n"]]],["SortSpec defines the criteria for sorting data. Key actions include retrieving the background and foreground colors used in sorting, if any. It fetches the data source column being sorted, or returns null if not present. It can retrieve the dimension index if linked to a filter. The sort order itself, along with whether the sorting is ascending, can also be obtained using the methods `getSortOrder()` and `isAscending()` respectively.\n"],null,["SortSpec\n\nThe sorting specification. \n\nMethods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------|---------------------------------------------------------------------------|------------------------------------------------------------------------|\n| [getBackgroundColor()](#getBackgroundColor()) | [Color](/apps-script/reference/spreadsheet/color) | Returns the background color used for sorting, or `null` if absent. |\n| [getDataSourceColumn()](#getDataSourceColumn()) | [DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) | Gets the data source column the sort spec acts on. |\n| [getDimensionIndex()](#getDimensionIndex()) | `Integer` | Returns the dimension index or `null` if not linked to a local filter. |\n| [getForegroundColor()](#getForegroundColor()) | [Color](/apps-script/reference/spreadsheet/color) | Returns the foreground color used for sorting, or `null` if absent. |\n| [getSortOrder()](#getSortOrder()) | [SortOrder](/apps-script/reference/spreadsheet/sort-order) | Returns the sort order. |\n| [isAscending()](#isAscending()) | `Boolean` | Returns whether the sort order is ascending. |\n\nDetailed documentation \n\n`get``Background``Color()` \nReturns the background color used for sorting, or `null` if absent.\n\nReturn\n\n\n[Color](/apps-script/reference/spreadsheet/color) --- The background color.\n\nAuthorization\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``Column()` \nGets the data source column the sort spec acts on. Returns `null` if this sort spec is\nnot acting on a data source column.\n\nReturn\n\n\n[DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) --- The data source column the sort spec acts on.\n\nAuthorization\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``Dimension``Index()` \nReturns the dimension index or `null` if not linked to a local filter.\n\nReturn\n\n\n`Integer` --- The dimension index.\n\nAuthorization\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``Foreground``Color()` \nReturns the foreground color used for sorting, or `null` if absent.\n\nReturn\n\n\n[Color](/apps-script/reference/spreadsheet/color) --- The foreground color.\n\nAuthorization\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``Sort``Order()` \nReturns the sort order.\n\nReturn\n\n\n[SortOrder](/apps-script/reference/spreadsheet/sort-order) --- The sort order.\n\nAuthorization\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`is``Ascending()` \nReturns whether the sort order is ascending.\n\nReturn\n\n\n`Boolean` --- `true` if the sort order is ascending, or `false` otherwise.\n\nAuthorization\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`"]]