Enum ItemType
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
ItemType
Um tipo enumerado que representa os tipos de itens de formulário aceitos. Os tipos de item podem ser acessados em FormApp.ItemType
.
Para chamar um tipo enumerado, chame a classe mãe, o nome e a propriedade dele. Por exemplo,
FormApp.ItemType.CHECKBOX
.
// Open a form by ID and add a new section header.
const form = FormApp.create('Form Name');
const item = form.addSectionHeaderItem();
item.setTitle('Title of new section');
// Check the item type.
if (item.getType() === FormApp.ItemType.SECTION_HEADER) {
item.setHelpText('Description of new section.');
}
Propriedades
Propriedade | Tipo | Descrição |
CHECKBOX | Enum | Um item de pergunta que permite ao respondente selecionar uma ou mais caixas de seleção, além de um campo opcional "Outro". |
CHECKBOX_GRID | Enum | Um item de pergunta, apresentado como uma grade de colunas e linhas, que permite ao participante selecionar
várias opções por linha em uma sequência de caixas de seleção. |
DATE | Enum | Um item de pergunta que permite ao respondente indicar uma data. |
DATETIME | Enum | Um item de pergunta que permite ao participante indicar uma data e hora. |
DURATION | Enum | Um item de pergunta que permite ao participante indicar um período de tempo. |
GRID | Enum | Um item de pergunta, apresentado como uma grade de colunas e linhas, que permite ao participante selecionar
uma opção por linha em uma sequência de botões de opção. |
IMAGE | Enum | Um item de layout que mostra uma imagem. |
LIST | Enum | Um item de pergunta que permite ao participante selecionar uma opção em uma lista suspensa. |
MULTIPLE_CHOICE | Enum | Um item de pergunta que permite ao respondente selecionar uma opção em uma lista de botões de opção ou
um campo opcional "Outro". |
PAGE_BREAK | Enum | Um item de layout que marca o início de uma página. |
PARAGRAPH_TEXT | Enum | Um item de pergunta que permite que o participante insira um bloco de texto. |
RATING | Enum | Um item de pergunta que permite ao participante dar uma nota. |
SCALE | Enum | Item de pergunta que permite ao participante escolher uma opção de uma sequência numerada de
botões de opção. |
SECTION_HEADER | Enum | Um item de layout que indica visualmente o início de uma seção. |
TEXT | Enum | Um item de pergunta que permite que o participante insira uma única linha de texto. |
TIME | Enum | Um item de pergunta que permite ao participante indicar um horário do dia. |
VIDEO | Enum | Um item de layout que mostra um vídeo do YouTube. |
FILE_UPLOAD | Enum | Um item de pergunta que permite que o participante faça upload de um arquivo. |
UNSUPPORTED | Enum | Um item que não tem suporte de APIs no momento. |
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-26 UTC.
[null,null,["Última atualização 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eItemType\u003c/code\u003e is an enum representing the types of items you can add to a Google Form, such as questions, images, and page breaks.\u003c/p\u003e\n"],["\u003cp\u003eYou can access \u003ccode\u003eItemType\u003c/code\u003e properties like \u003ccode\u003eCHECKBOX\u003c/code\u003e, \u003ccode\u003eTEXT\u003c/code\u003e, and \u003ccode\u003ePAGE_BREAK\u003c/code\u003e using \u003ccode\u003eFormApp.ItemType\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003eItemType\u003c/code\u003e property represents a different kind of form element you can add and manipulate using Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003eitem.getType()\u003c/code\u003e to determine the type of an existing item in your form and adjust its properties accordingly.\u003c/p\u003e\n"]]],[],null,["# Enum ItemType\n\nItemType\n\nAn enum representing the supported types of form items. Item types can be accessed from [FormApp.ItemType](/apps-script/reference/forms/form-app#ItemType).\n\nTo call an enum, you call its parent class, name, and property. For example, `\nFormApp.ItemType.CHECKBOX`.\n\n```javascript\n// Open a form by ID and add a new section header.\nconst form = FormApp.create('Form Name');\nconst item = form.addSectionHeaderItem();\nitem.setTitle('Title of new section');\n\n// Check the item type.\nif (item.getType() === FormApp.ItemType.SECTION_HEADER) {\n item.setHelpText('Description of new section.');\n}\n``` \n\n### Properties\n\n| Property | Type | Description |\n|-------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `CHECKBOX` | `Enum` | A question item that allows the respondent to select one or more checkboxes, as well as an optional \"other\" field. |\n| `CHECKBOX_GRID` | `Enum` | A question item, presented as a grid of columns and rows, that allows the respondent to select multiple choices per row from a sequence of checkboxes. |\n| `DATE` | `Enum` | A question item that allows the respondent to indicate a date. |\n| `DATETIME` | `Enum` | A question item that allows the respondent to indicate a date and time. |\n| `DURATION` | `Enum` | A question item that allows the respondent to indicate a length of time. |\n| `GRID` | `Enum` | A question item, presented as a grid of columns and rows, that allows the respondent to select one choice per row from a sequence of radio buttons. |\n| `IMAGE` | `Enum` | A layout item that displays an image. |\n| `LIST` | `Enum` | A question item that allows the respondent to select one choice from a drop-down list. |\n| `MULTIPLE_CHOICE` | `Enum` | A question item that allows the respondent to select one choice from a list of radio buttons or an optional \"other\" field. |\n| `PAGE_BREAK` | `Enum` | A layout item that marks the start of a page. |\n| `PARAGRAPH_TEXT` | `Enum` | A question item that allows the respondent to enter a block of text. |\n| `RATING` | `Enum` | A question item that allows the respondent to give a rating. |\n| `SCALE` | `Enum` | A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |\n| `SECTION_HEADER` | `Enum` | A layout item that visually indicates the start of a section. |\n| `TEXT` | `Enum` | A question item that allows the respondent to enter a single line of text. |\n| `TIME` | `Enum` | A question item that allows the respondent to indicate a time of day. |\n| `VIDEO` | `Enum` | A layout item that displays a YouTube video. |\n| `FILE_UPLOAD` | `Enum` | A question item that lets the respondent upload a file. |\n| `UNSUPPORTED` | `Enum` | An item that is currently not supported through APIs. |"]]