Access and modify existing data source. To create a data source table with new data source, see
DataSourceTable
.
Methods
Method | Return type | Brief description |
---|---|---|
getSpec() | DataSourceSpec | Gets the data source specification. |
updateSpec(spec) | DataSource | Updates the data source specification and refreshes the data source objects linked with this data source with the new specification. |
Detailed documentation
getSpec()
Gets the data source specification.
Return
DataSourceSpec
— The data source specification.
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
updateSpec(spec)
Updates the data source specification and refreshes the data source objects linked with this data source with the new specification.
Throws an exception if the data source type is not enabled. Use SpreadsheetApp#enable...Execution()
methods to enable data execution for specific data source
type.
Parameters
Name | Type | Description |
---|---|---|
spec | DataSourceSpec | The data source specification to update with. |
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