Class SectionHeaderItem

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建立這個項目的副本,並附加到表單結尾。
getHelpText()String取得項目的說明文字 (有時稱為版面配置項目的說明文字,例如 ImageItemsPageBreakItemsSectionHeaderItems)。
getId()Integer取得項目的專屬 ID。
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()

取得項目的專屬 ID。

回攻員

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