Class SectionHeaderItem

SectionHeaderItem

一种布局项,直观地指示部分开始。可以通过 Form 访问或创建项。

// Open a form by ID and add a new section header.
var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
var item = form.addSectionHeaderItem();
item.setTitle('Title of new section');

方法

方法返回类型简介
duplicate()SectionHeaderItem创建此项目的副本,并将其附加到表单的末尾。
getHelpText()String获取该项的帮助文本(有时称为 ImageItemsPageBreakItemsSectionHeaderItems 等布局项的说明文本)。
getId()Integer获取项的唯一标识符。
getIndex()Integer获取表单中所有项中的项的索引。
getTitle()String获取商品的标题(如果为 SectionHeaderItem,则有时称为标题文本)。
getType()ItemType获取该项的类型,表示为 ItemType
setHelpText(text)SectionHeaderItem设置项的帮助文本(有时称为 ImageItemsPageBreakItemsSectionHeaderItems 等布局项的说明文本)。
setTitle(title)SectionHeaderItem设置项目的标题(如果为 SectionHeaderItem,则有时称为标题文本)。

详细文档

duplicate()

创建此项目的副本,并将其附加到表单的末尾。

弃踢回攻

SectionHeaderItem - 此 SectionHeaderItem 的副本,用于链接

授权

使用此方法的脚本需要获得以下一个或多个范围的授权:

  • https://www.googleapis.com/auth/forms.currentonly
  • https://www.googleapis.com/auth/forms

getHelpText()

获取该项的帮助文本(有时称为 ImageItemsPageBreakItemsSectionHeaderItems 等布局项的说明文本)。

弃踢回攻

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

setHelpText(text)

设置项的帮助文本(有时称为 ImageItemsPageBreakItemsSectionHeaderItems 等布局项的说明文本)。

参数

名称类型说明
textString新的帮助文本

弃踢回攻

SectionHeaderItem - 此 SectionHeaderItem,用于链接

授权

使用此方法的脚本需要获得以下一个或多个范围的授权:

  • https://www.googleapis.com/auth/forms.currentonly
  • https://www.googleapis.com/auth/forms

setTitle(title)

设置项目的标题(如果为 SectionHeaderItem,则有时称为标题文本)。

参数

名称类型说明
titleString新标题或标题文字

弃踢回攻

SectionHeaderItem - 此 SectionHeaderItem,用于链接

授权

使用此方法的脚本需要获得以下一个或多个范围的授权:

  • https://www.googleapis.com/auth/forms.currentonly
  • https://www.googleapis.com/auth/forms