AI-generated Key Takeaways
-
SectionHeaderItemis a layout item in Google Forms that visually indicates the start of a section. -
You can access or create a
SectionHeaderItemfrom aFormobject. -
Methods available for
SectionHeaderIteminclude getting and setting the title and help text, duplicating the item, and getting its ID, index, and type. -
Using
setHelpText()andsetTitle()methods allows you to modify the text displayed for the section header. -
Scripts using these methods require specific authorization scopes related to Google Forms.
A layout item that visually indicates the start of a section. Items can be accessed or created
from a 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' );
Methods
| Method | Return type | Brief description |
|---|---|---|
Section
|
Creates a copy of this item and appends it to the end of the form. | |
String
|
Gets the item's help text (sometimes called description text for layout items like Image
, Page
, and Section
). |
|
Integer
|
Gets the item's unique identifier. | |
Integer
|
Gets the index of the item among all the items in the form. | |
String
|
Gets the item's title (sometimes called header text, in the case of a Section
). |
|
Item
|
Gets the item's type, represented as an Item
. |
|
Section
|
Sets the item's help text (sometimes called description text for layout items like Image
, Page
, and Section
). |
|
Section
|
Sets the item's title (sometimes called header text, in the case of a Section
). |
Detailed documentation
duplicate()
Creates a copy of this item and appends it to the end of the form.
Return
Section
— a duplicate of this Section
, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get
Help
Text()
Gets the item's help text (sometimes called description text for layout items like Image
, Page
, and Section
).
Return
String
— the item's help text or description text
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get
Id()
Gets the item's unique identifier.
Return
Integer
— the item's ID
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get
Index()
Gets the index of the item among all the items in the form.
Return
Integer
— the index of the item
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get
Title()
Gets the item's title (sometimes called header text, in the case of a Section
).
Return
String
— the item's title or header text
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get
Type()
set
Help
Text(text)
Sets the item's help text (sometimes called description text for layout items like Image
, Page
, and Section
).
Parameters
| Name | Type | Description |
|---|---|---|
text
|
String
|
the new help text |
Return
Section
— this Section
, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set
Title(title)
Sets the item's title (sometimes called header text, in the case of a Section
).
Parameters
| Name | Type | Description |
|---|---|---|
title
|
String
|
the new title or header text |
Return
Section
— this Section
, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms

