Class DataSourceColumn
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
데이터소스열
데이터 소스 열에 액세스하고 수정합니다.
이 클래스는 데이터베이스에 연결된 데이터에만 사용합니다.
자세한 문서
getDataSource()
데이터 소스 열과 연결된 데이터 소스를 가져옵니다.
리턴
DataSource
: 데이터 소스입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
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
setName(name)
데이터 소스 열의 이름을 설정합니다.
calculated columns
에서만 지원됩니다.
매개변수
이름 | 유형 | 설명 |
name | String | 설정할 이름입니다. |
리턴
DataSourceColumn
: 체이닝을 위한 데이터 소스 열입니다.
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 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,["# Class DataSourceColumn\n\nDataSourceColumn\n\nAccess and modify a data source column.\n\n\n**Only use this class with data that's connected to a database.** \n\n### Methods\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\n### `get``Data``Source()`\n\nGets the data source associated with the data source column.\n\n#### Return\n\n\n[DataSource](/apps-script/reference/spreadsheet/data-source) --- The data source.\n\n#### Authorization\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()`\n\nGets the formula for the data source column. Returns an empty string if the data source column\nis not a [calculated column](#isCalculatedColumn()).\n\n#### Return\n\n\n`String` --- The formula.\n\n#### Authorization\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()`\n\nGets the name for the data source column.\n\n#### Return\n\n\n`String` --- The column name.\n\n#### Authorization\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()`\n\nReturns whether the column has an array dependency.\n\n#### Return\n\n\n`Boolean` --- `true` if the column has an array dependency, or `false` otherwise.\n\n#### Authorization\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()`\n\nReturns whether the column is a calculated column.\n\n#### Return\n\n\n`Boolean` --- `true` if the column is a calculated column, or `false` otherwise.\n\n#### Authorization\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()`\n\nRemoves the data source column.\n\nOnly supported for [calculated columns](#isCalculatedColumn()).\n\n#### Authorization\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)`\n\nSets the formula for the data source column.\n\nOnly supported for [calculated columns](#isCalculatedColumn()).\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------|----------|------------------|\n| `formula` | `String` | The new formula. |\n\n#### Return\n\n\n[DataSourceColumn](#) --- The data source column, for chaining.\n\n#### Authorization\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)`\n\nSets the name of the data source column.\n\nOnly supported for [calculated columns](#isCalculatedColumn()).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|----------|------------------|\n| `name` | `String` | The name to set. |\n\n#### Return\n\n\n[DataSourceColumn](#) --- The data source column, for chaining.\n\n#### Authorization\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`"]]