存取及修改資料來源欄。
請只將這個類別用於與資料庫連線的資料。
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
get | Data | 取得與資料來源資料欄相關聯的資料來源。 |
get | String | 取得資料來源欄的公式。 |
get | String | 取得資料來源資料欄的名稱。 |
has | Boolean | 傳回資料欄是否具有陣列依附元件。 |
is | Boolean | 傳回資料欄是否為計算結果欄。 |
remove() | void | 移除資料來源資料欄。 |
set | Data | 設定資料來源資料欄的公式。 |
set | Data | 設定資料來源資料欄的名稱。 |
內容詳盡的說明文件
getDataSource()
取得與資料來源資料欄相關聯的資料來源。
回攻員
DataSource:資料來源。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getFormula()
取得資料來源欄的公式。如果資料來源欄不是 calculated column,則傳回空白字串。
回攻員
String:公式。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
getName()
取得資料來源資料欄的名稱。
回攻員
String:資料欄名稱。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
hasArrayDependency()
傳回資料欄是否具有陣列依附元件。
回攻員
Boolean:如果資料欄有陣列依附元件,則為 true,否則為 false。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
isCalculatedColumn()
傳回資料欄是否為計算結果欄。
回攻員
Boolean:如果資料欄是計算結果欄,則為 true,否則為 false。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
remove()
移除資料來源資料欄。
僅支援 calculated columns。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setFormula(formula)
設定資料來源資料欄的公式。
僅支援 calculated columns。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
formula | String | 新公式。 |
回攻員
DataSourceColumn - 資料來源欄,用於串連。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
setName(name)
設定資料來源資料欄的名稱。
僅支援 calculated columns。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
name | String | 要設定的名稱。 |
回攻員
DataSourceColumn - 資料來源欄,用於串連。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets