Class SectionHeaderItem
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
섹션헤더항목
섹션의 시작을 시각적으로 나타내는 레이아웃 항목입니다. Form
에서 항목에 액세스하거나 항목을 만들 수 있습니다.
// Open a form by ID and add a new section header.
const form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
const item = form.addSectionHeaderItem();
item.setTitle('Title of new section');
자세한 문서
duplicate()
이 항목의 사본을 만들어 양식 끝에 추가합니다.
리턴
SectionHeaderItem
: 체이닝을 위한 이 SectionHeaderItem
의 중복
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getHelpText()
항목의 도움말 텍스트 (ImageItems
, PageBreakItems
, SectionHeaderItems
와 같은 레이아웃 항목의 경우 설명 텍스트라고도 함)를 가져옵니다.
리턴
String
: 상품의 도움말 텍스트 또는 설명 텍스트
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getId()
항목의 고유 식별자를 가져옵니다.
리턴
Integer
: 상품 ID
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getIndex()
양식의 모든 항목 중에서 항목의 색인을 가져옵니다.
리턴
Integer
: 항목의 색인
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getTitle()
항목의 제목을 가져옵니다 (SectionHeaderItem
의 경우 헤더 텍스트라고도 함).
리턴
String
: 항목의 제목 또는 헤더 텍스트
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getType()
ItemType
로 표시되는 항목 유형을 가져옵니다.
리턴
ItemType
: 항목 유형
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setTitle(title)
항목의 제목을 설정합니다 (SectionHeaderItem
의 경우 헤더 텍스트라고도 함).
매개변수
이름 | 유형 | 설명 |
title | String | 새 제목 또는 헤더 텍스트 |
리턴
SectionHeaderItem
— 체이닝을 위한 이 SectionHeaderItem
승인
이 메서드를 사용하는 스크립트에는 다음 범위 중 하나 이상의 승인이 필요합니다.
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eA \u003ccode\u003eSectionHeaderItem\u003c/code\u003e visually separates sections within a Google Form, enhancing organization and readability for respondents.\u003c/p\u003e\n"],["\u003cp\u003eYou can programmatically add, duplicate, and modify \u003ccode\u003eSectionHeaderItems\u003c/code\u003e using Apps Script methods like \u003ccode\u003esetTitle()\u003c/code\u003e, \u003ccode\u003esetHelpText()\u003c/code\u003e, and \u003ccode\u003eduplicate()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSectionHeaderItems\u003c/code\u003e provide methods to retrieve their properties, such as \u003ccode\u003egetTitle()\u003c/code\u003e, \u003ccode\u003egetHelpText()\u003c/code\u003e, \u003ccode\u003egetId()\u003c/code\u003e, \u003ccode\u003egetIndex()\u003c/code\u003e, and \u003ccode\u003egetType()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization with specific scopes like \u003ccode\u003ehttps://www.googleapis.com/auth/forms\u003c/code\u003e is necessary when using Apps Script to interact with \u003ccode\u003eSectionHeaderItems\u003c/code\u003e and other form elements.\u003c/p\u003e\n"]]],[],null,["# Class SectionHeaderItem\n\nSectionHeaderItem\n\nA layout item that visually indicates the start of a section. Items can be accessed or created\nfrom a [Form](/apps-script/reference/forms/form).\n\n```javascript\n// Open a form by ID and add a new section header.\nconst form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');\nconst item = form.addSectionHeaderItem();\nitem.setTitle('Title of new section');\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------|----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [duplicate()](#duplicate()) | [SectionHeaderItem](#) | Creates a copy of this item and appends it to the end of the form. |\n| [getHelpText()](#getHelpText()) | `String` | Gets the item's help text (sometimes called description text for layout items like [ImageItems](/apps-script/reference/forms/image-item), [PageBreakItems](/apps-script/reference/forms/page-break-item), and [SectionHeaderItems](#)). |\n| [getId()](#getId()) | `Integer` | Gets the item's unique identifier. |\n| [getIndex()](#getIndex()) | `Integer` | Gets the index of the item among all the items in the form. |\n| [getTitle()](#getTitle()) | `String` | Gets the item's title (sometimes called header text, in the case of a [SectionHeaderItem](#)). |\n| [getType()](#getType()) | [ItemType](/apps-script/reference/forms/item-type) | Gets the item's type, represented as an [ItemType](/apps-script/reference/forms/item-type). |\n| [setHelpText(text)](#setHelpText(String)) | [SectionHeaderItem](#) | Sets the item's help text (sometimes called description text for layout items like [ImageItems](/apps-script/reference/forms/image-item), [PageBreakItems](/apps-script/reference/forms/page-break-item), and [SectionHeaderItems](#)). |\n| [setTitle(title)](#setTitle(String)) | [SectionHeaderItem](#) | Sets the item's title (sometimes called header text, in the case of a [SectionHeaderItem](#)). |\n\nDetailed documentation\n----------------------\n\n### `duplicate()`\n\nCreates a copy of this item and appends it to the end of the form.\n\n#### Return\n\n\n[SectionHeaderItem](#) --- a duplicate of this [SectionHeaderItem](#), 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/forms.currentonly`\n- `https://www.googleapis.com/auth/forms`\n\n*** ** * ** ***\n\n### `get``Help``Text()`\n\nGets the item's help text (sometimes called description text for layout items like [ImageItems](/apps-script/reference/forms/image-item), [PageBreakItems](/apps-script/reference/forms/page-break-item), and [SectionHeaderItems](#)).\n\n#### Return\n\n\n`String` --- the item's help text or description text\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/forms.currentonly`\n- `https://www.googleapis.com/auth/forms`\n\n*** ** * ** ***\n\n### `get``Id()`\n\nGets the item's unique identifier.\n\n#### Return\n\n\n`Integer` --- the item's ID\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/forms.currentonly`\n- `https://www.googleapis.com/auth/forms`\n\n*** ** * ** ***\n\n### `get``Index()`\n\nGets the index of the item among all the items in the form.\n\n#### Return\n\n\n`Integer` --- the index of the item\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/forms.currentonly`\n- `https://www.googleapis.com/auth/forms`\n\n*** ** * ** ***\n\n### `get``Title()`\n\nGets the item's title (sometimes called header text, in the case of a [SectionHeaderItem](#)).\n\n#### Return\n\n\n`String` --- the item's title or header text\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/forms.currentonly`\n- `https://www.googleapis.com/auth/forms`\n\n*** ** * ** ***\n\n### `get``Type()`\n\nGets the item's type, represented as an [ItemType](/apps-script/reference/forms/item-type).\n\n#### Return\n\n\n[ItemType](/apps-script/reference/forms/item-type) --- the item's type\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/forms.currentonly`\n- `https://www.googleapis.com/auth/forms`\n\n*** ** * ** ***\n\n### `set``Help``Text(text)`\n\nSets the item's help text (sometimes called description text for layout items like [ImageItems](/apps-script/reference/forms/image-item), [PageBreakItems](/apps-script/reference/forms/page-break-item), and [SectionHeaderItems](#)).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|----------|-------------------|\n| `text` | `String` | the new help text |\n\n#### Return\n\n\n[SectionHeaderItem](#) --- this [SectionHeaderItem](#), 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/forms.currentonly`\n- `https://www.googleapis.com/auth/forms`\n\n*** ** * ** ***\n\n### `set``Title(title)`\n\nSets the item's title (sometimes called header text, in the case of a [SectionHeaderItem](#)).\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|----------|------------------------------|\n| `title` | `String` | the new title or header text |\n\n#### Return\n\n\n[SectionHeaderItem](#) --- this [SectionHeaderItem](#), 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/forms.currentonly`\n- `https://www.googleapis.com/auth/forms`"]]