Class DataSourceColumn | Apps Script | Google for Developers (original) (raw)
Class DataSourceColumn
Stay organized with collections Save and categorize content based on your preferences.
DataSourceColumn
Access and modify a data source column.
Only use this class with data that's connected to a database.
Methods
Method | Return type | Brief description |
---|---|---|
getDataSource() | DataSource | Gets the data source associated with the data source column. |
getFormula() | String | Gets the formula for the data source column. |
getName() | String | Gets the name for the data source column. |
hasArrayDependency() | Boolean | Returns whether the column has an array dependency. |
isCalculatedColumn() | Boolean | Returns whether the column is a calculated column. |
remove() | void | Removes the data source column. |
setFormula(formula) | DataSourceColumn | Sets the formula for the data source column. |
setName(name) | DataSourceColumn | Sets the name of the data source column. |
Detailed documentation
getDataSource()
Gets the data source associated with the data source column.
Return
[DataSource](/apps-script/reference/spreadsheet/data-source)
— The data source.
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
getFormula()
Gets the formula for the data source column. Returns an empty string if the data source column is not a [calculated column](#isCalculatedColumn%28%29)
.
Return
String
— The formula.
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
getName()
Gets the name for the data source column.
Return
String
— The column name.
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
hasArrayDependency()
Returns whether the column has an array dependency.
Return
Boolean
— true
if the column has an array dependency, or false
otherwise.
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
isCalculatedColumn()
Returns whether the column is a calculated column.
Return
Boolean
— true
if the column is a calculated column, or false
otherwise.
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 the data source column.
Only supported for [calculated columns](#isCalculatedColumn%28%29)
.
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
setFormula(formula)
Sets the formula for the data source column.
Only supported for [calculated columns](#isCalculatedColumn%28%29)
.
Parameters
Name | Type | Description |
---|---|---|
formula | String | The new formula. |
Return
[DataSourceColumn](#)
— The data source column, 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
setName(name)
Sets the name of the data source column.
Only supported for [calculated columns](#isCalculatedColumn%28%29)
.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name to set. |
Return
[DataSourceColumn](#)
— The data source column, 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
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.