Class DataSourceColumn

DataSourceColumn

Access and modify a data source column.

Only use this class with data that's connected to a database.

Methods

MethodReturn typeBrief description
getDataSource()DataSourceGets the data source associated with the data source column.
getFormula()StringGets the formula for the data source column.
getName()StringGets the name for the data source column.
hasArrayDependency()BooleanReturns whether the column has an array dependency.
isCalculatedColumn()BooleanReturns whether the column is a calculated column.
remove()voidRemoves the data source column.
setFormula(formula)DataSourceColumnSets the formula for the data source column.
setName(name)DataSourceColumnSets the name of the data source column.

Detailed documentation

getDataSource()

Gets the data source associated with the data source column.

Return

DataSource — The data source.

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

getFormula()

Gets the formula for the data source column. Returns an empty string if the data source column is not a calculated column.

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

Booleantrue 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

Booleantrue 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.

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.

Parameters

NameTypeDescription
formulaStringThe 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.

Parameters

NameTypeDescription
nameStringThe 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