[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eDataSourceColumn\u003c/code\u003e class allows you to programmatically access and modify data source columns connected to a database in Google Sheets.\u003c/p\u003e\n"],["\u003cp\u003eYou can get and set the formula and name for calculated columns, as well as get the associated data source and check for array dependencies.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides methods for checking if a column is calculated or has array dependencies, along with the ability to remove calculated columns.\u003c/p\u003e\n"],["\u003cp\u003eAll methods within the \u003ccode\u003eDataSourceColumn\u003c/code\u003e class require authorization with specific Google Sheets scopes.\u003c/p\u003e\n"]]],[],null,["DataSourceColumn\n\nAccess and modify a data source column.\n\n\n**Only use this class with data that's connected to a database.** \n\nMethods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------|--------------------------------------------------------------|--------------------------------------------------------------|\n| [getDataSource()](#getDataSource()) | [DataSource](/apps-script/reference/spreadsheet/data-source) | Gets the data source associated with the data source column. |\n| [getFormula()](#getFormula()) | `String` | Gets the formula for the data source column. |\n| [getName()](#getName()) | `String` | Gets the name for the data source column. |\n| [hasArrayDependency()](#hasArrayDependency()) | `Boolean` | Returns whether the column has an array dependency. |\n| [isCalculatedColumn()](#isCalculatedColumn()) | `Boolean` | Returns whether the column is a calculated column. |\n| [remove()](#remove()) | `void` | Removes the data source column. |\n| [setFormula(formula)](#setFormula(String)) | [DataSourceColumn](#) | Sets the formula for the data source column. |\n| [setName(name)](#setName(String)) | [DataSourceColumn](#) | Sets the name of the data source column. |\n\nDetailed documentation \n\n`get``Data``Source()` \nGets the data source associated with the data source column.\n\nReturn\n\n\n[DataSource](/apps-script/reference/spreadsheet/data-source) --- The data source.\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``Formula()` \nGets the formula for the data source column. Returns an empty string if the data source column\nis not a [calculated column](#isCalculatedColumn()).\n\nReturn\n\n\n`String` --- The formula.\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``Name()` \nGets the name for the data source column.\n\nReturn\n\n\n`String` --- The column name.\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`has``Array``Dependency()` \nReturns whether the column has an array dependency.\n\nReturn\n\n\n`Boolean` --- `true` if the column has an array dependency, 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`\n\n*** ** * ** ***\n\n`is``Calculated``Column()` \nReturns whether the column is a calculated column.\n\nReturn\n\n\n`Boolean` --- `true` if the column is a calculated column, 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`\n\n*** ** * ** ***\n\n`remove()` \nRemoves the data source column.\n\nOnly supported for [calculated columns](#isCalculatedColumn()).\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`set``Formula(formula)` \nSets the formula for the data source column.\n\nOnly supported for [calculated columns](#isCalculatedColumn()).\n\nParameters\n\n| Name | Type | Description |\n|-----------|----------|------------------|\n| `formula` | `String` | The new formula. |\n\nReturn\n\n\n[DataSourceColumn](#) --- The data source column, for chaining.\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`set``Name(name)` \nSets the name of the data source column.\n\nOnly supported for [calculated columns](#isCalculatedColumn()).\n\nParameters\n\n| Name | Type | Description |\n|--------|----------|------------------|\n| `name` | `String` | The name to set. |\n\nReturn\n\n\n[DataSourceColumn](#) --- The data source column, for chaining.\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`"]]