This service allows scripts to create, access, and modify Google Forms.
// Create a new form, then add a checkbox question, a multiple choice question, // a page break, then a date question and a grid of questions. var form = FormApp.create('New Form'); var item = form.addCheckboxItem(); item.setTitle('What condiments would you like on your hot dog?'); item.setChoices([ item.createChoice('Ketchup'), item.createChoice('Mustard'), item.createChoice('Relish') ]); form.addMultipleChoiceItem() .setTitle('Do you prefer cats or dogs?') .setChoiceValues(['Cats','Dogs']) .showOtherOption(true); form.addPageBreakItem() .setTitle('Getting to know you'); form.addDateItem() .setTitle('When were you born?'); form.addGridItem() .setTitle('Rate your interests') .setRows(['Cars', 'Computers', 'Celebrities']) .setColumns(['Boring', 'So-so', 'Interesting']); Logger.log('Published URL: ' + form.getPublishedUrl()); Logger.log('Editor URL: ' + form.getEditUrl());
Classes
Name | Brief description |
---|---|
Alignment | An enum representing the supported types of image alignment. |
CheckboxItem | A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. |
Choice | A single choice associated with a type of Item that supports choices, like
CheckboxItem , ListItem , or MultipleChoiceItem . |
DateItem | A question item that allows the respondent to indicate a date. |
DateTimeItem | A question item that allows the respondent to indicate a date and time. |
DestinationType | An enum representing the supported types of form-response destinations. |
DurationItem | A question item that allows the respondent to indicate a length of time. |
Form | A form that contains overall properties (such as title, settings, and where responses are stored) and items (which includes question items like checkboxes and layout items like page breaks). |
FormApp | Allows a script to open existing Forms or create new ones. |
FormResponse | A response to the form as a whole. |
GridItem | 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. |
ImageItem | A layout item that displays an image. |
Item | A generic form item that contains properties common to all items, such as title and help text. |
ItemResponse | A response to one question item within a form. |
ItemType | An enum representing the supported types of form items. |
ListItem | A question item that allows the respondent to select one choice from a drop-down list. |
MultipleChoiceItem | A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. |
PageBreakItem | A layout item that marks the start of a page. |
PageNavigationType | An enum representing the supported types of page navigation. |
ParagraphTextItem | A question item that allows the respondent to enter a block of text. |
ScaleItem | A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |
SectionHeaderItem | A layout item that visually indicates the start of a section. |
TextItem | A question item that allows the respondent to enter a single line of text. |
TimeItem | A question item that allows the respondent to indicate a time of day. |
VideoItem | A layout item that displays a video. |
Class Alignment
Properties
Property | Type | Description |
---|---|---|
LEFT | Enum | Align the image to the left side of the form. |
CENTER | Enum | Align the image to the center of the form. |
RIGHT | Enum | Align the image to the right side of the form. |
Class CheckboxItem
Methods
Method | Return type | Brief description |
---|---|---|
createChoice(value) | Choice | Creates a new choice. |
createResponse(responses) | ItemResponse | Creates a new ItemResponse for this checkbox item. |
duplicate() | CheckboxItem | Creates a copy of this item and appends it to the end of the form. |
getChoices() | Choice[] | Gets all choices for an item. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
hasOtherOption() | Boolean | Determines whether the item has an "other" option. |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setChoiceValues(values) | CheckboxItem | Sets the choices for an item from an array of strings. |
setChoices(choices) | CheckboxItem | Sets an array of choices for an item. |
setHelpText(text) | CheckboxItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setRequired(enabled) | CheckboxItem | Sets whether the respondent must answer the question. |
setTitle(title) | CheckboxItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
showOtherOption(enabled) | CheckboxItem | Sets whether the item has an "other" option. |
Class Choice
Methods
Method | Return type | Brief description |
---|---|---|
getGotoPage() | PageBreakItem | Gets the PageBreakItem set as a GO_TO_PAGE destination
if the responder selects this choice and completes the current page. |
getPageNavigationType() | PageNavigationType | Gets the PageNavigationType that occurs if the responder selects this choice and
completes the current page. |
getValue() | String | Gets the choice's value, which respondents see as a label when viewing the form. |
Class DateItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(response) | ItemResponse | Creates a new ItemResponse for this date item. |
duplicate() | DateItem | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
includesYear() | Boolean | Determines whether the date item includes a year option. |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setHelpText(text) | DateItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setIncludesYear(enableYear) | DateItem | Sets whether the date item includes a year setting. |
setRequired(enabled) | DateItem | Sets whether the respondent must answer the question. |
setTitle(title) | DateItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class DateTimeItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(response) | ItemResponse | Creates a new ItemResponse for this date-time item. |
duplicate() | DateTimeItem | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
includesYear() | Boolean | Determines whether the date item includes a year option. |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setHelpText(text) | DateTimeItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setIncludesYear(enableYear) | DateTimeItem | Sets whether the date item includes a year setting. |
setRequired(enabled) | DateTimeItem | Sets whether the respondent must answer the question. |
setTitle(title) | DateTimeItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class DestinationType
Properties
Property | Type | Description |
---|---|---|
SPREADSHEET | Enum | A Google Sheets spreadsheet as a destination for form responses. |
Class DurationItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(hours, minutes, seconds) | ItemResponse | Creates a new ItemResponse for this date item. |
duplicate() | DurationItem | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setHelpText(text) | DurationItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setRequired(enabled) | DurationItem | Sets whether the respondent must answer the question. |
setTitle(title) | DurationItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class Form
Methods
Method | Return type | Brief description |
---|---|---|
addCheckboxItem() | CheckboxItem | Appends a new question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. |
addDateItem() | DateItem | Appends a new question item that allows the respondent to indicate a date. |
addDateTimeItem() | DateTimeItem | Appends a new question item that allows the respondent to indicate a date and time. |
addDurationItem() | DurationItem | Appends a new question item that allows the respondent to indicate a length of time. |
addEditor(emailAddress) | Form | Adds the given user to the list of editors for the Form . |
addEditor(user) | Form | Adds the given user to the list of editors for the Form . |
addEditors(emailAddresses) | Form | Adds the given array of users to the list of editors for the Form . |
addGridItem() | GridItem | Appends a new 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. |
addImageItem() | ImageItem | Appends a new layout item that displays an image. |
addListItem() | ListItem | Appends a new question item that allows the respondent to select one choice from a drop-down list. |
addMultipleChoiceItem() | MultipleChoiceItem | Appends a new question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. |
addPageBreakItem() | PageBreakItem | Appends a new layout item that marks the start of a page. |
addParagraphTextItem() | ParagraphTextItem | Appends a new question item that allows the respondent to enter a block of text. |
addScaleItem() | ScaleItem | Appends a new question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |
addSectionHeaderItem() | SectionHeaderItem | Appends a new layout item that visually indicates the start of a section. |
addTextItem() | TextItem | Appends a new question item that allows the respondent to enter a single line of text. |
addTimeItem() | TimeItem | Appends a new question item that allows the respondent to indicate a time of day. |
addVideoItem() | VideoItem | Appends a new layout item that displays a video. |
canEditResponse() | Boolean | Determines whether the form displays a link to edit a response after submitting it. |
collectsEmail() | Boolean | Determines whether the form collects respondents' email addresses. |
createResponse() | FormResponse | Creates a new response to the form. |
deleteAllResponses() | Form | Deletes all submitted responses from the form's response store. |
deleteItem(index) | void | Deletes the item at a given index among all the items in the form. |
deleteItem(item) | void | Deletes the given item. |
getConfirmationMessage() | String | Gets the form's confirmation message. |
getCustomClosedFormMessage() | String | Gets the custom message that will be displayed if the form is not accepting responses, or an empty string if no custom message has been set. |
getDescription() | String | Gets the form's description. |
getDestinationId() | String | Gets the ID of the form's response destination. |
getDestinationType() | DestinationType | Gets the type of the form's response destination. |
getEditUrl() | String | Gets the URL that can be used to access the form's edit mode. |
getEditors() | User[] | Gets the list of editors for this Form . |
getId() | String | Gets the ID of the form. |
getItemById(id) | Item | Gets the item with a given ID. |
getItems() | Item[] | Gets an array of all items in the form. |
getItems(itemType) | Item[] | Gets an array of all items of a given type. |
getPublishedUrl() | String | Gets the URL that can be used to respond to the form. |
getResponse(responseId) | FormResponse | Gets a single form response based on its response ID. |
getResponses() | FormResponse[] | Gets an array of all of the form's responses. |
getResponses(timestamp) | FormResponse[] | Gets an array of all of the form's responses after a given date and time. |
getShuffleQuestions() | Boolean | Determines whether the order of the questions on each page of the form is randomized. |
getSummaryUrl() | String | Gets the URL that can be used to view a summary of the form's responses. |
getTitle() | String | Gets the form's title. |
hasLimitOneResponsePerUser() | Boolean | Determines whether the form allows only one response per respondent. |
hasProgressBar() | Boolean | Determines whether the form displays a progress bar. |
hasRespondAgainLink() | Boolean | Determines whether the form displays a link to submit another response after a respondent completes the form. |
isAcceptingResponses() | Boolean | Determines whether the form is currently accepting responses. |
isPublishingSummary() | Boolean | Determines whether the form displays a link to view a summary of responses after a respondent completes the form. |
moveItem(from, to) | Item | Moves an item at a given index among all the items in the form to another given index. |
moveItem(item, toIndex) | Item | Moves a given item to an given index among all the items in the form. |
removeDestination() | Form | Unlinks the form from its current response destination. |
removeEditor(emailAddress) | Form | Removes the given user from the list of editors for the Form . |
removeEditor(user) | Form | Removes the given user from the list of editors for the Form . |
requiresLogin() | Boolean | Determines whether the form requires respondents to log in to an account in the same domain or a subdomain before responding. |
setAcceptingResponses(enabled) | Form | Sets whether the form is currently accepting responses. |
setAllowResponseEdits(enabled) | Form | Sets whether the form displays a link to edit a response after submitting it. |
setCollectEmail(collect) | Form | Sets whether the form collects respondents' email addresses. |
setConfirmationMessage(message) | Form | Sets the form's confirmation message. |
setCustomClosedFormMessage(message) | Form | Sets the message to display if the form is not accepting responses. |
setDescription(description) | Form | Sets the form's description. |
setDestination(type, id) | Form | Sets the destination where form responses are saved. |
setLimitOneResponsePerUser(enabled) | Form | Sets whether the form allows only one response per respondent. |
setProgressBar(enabled) | Form | Sets whether the form has a progress bar. |
setPublishingSummary(enabled) | Form | Sets whether the form displays a link to view a summary of responses after a respondent submits the form. |
setRequireLogin(requireLogin) | Form | Sets whether the form requires respondents to log in to an account in the same domain or a subdomain before responding. |
setShowLinkToRespondAgain(enabled) | Form | Sets whether the form displays a link to submit another response after a respondent completes the form. |
setShuffleQuestions(shuffle) | Form | Sets whether the order of the questions on each page of the form is randomized. |
setTitle(title) | Form | Sets the form's title. |
shortenFormUrl(url) | String | Converts a long URL for a form to a short URL. |
Class FormApp
Properties
Property | Type | Description |
---|---|---|
Alignment | Alignment | An enumeration of types of image alignment. |
DestinationType | DestinationType | An enumeration of types of destinations that can store form responses. |
ItemType | ItemType | An enumeration of types of form Items . |
PageNavigationType | PageNavigationType | An enumeration of possible behaviors for navigating pages. |
Methods
Method | Return type | Brief description |
---|---|---|
create(title) | Form | Creates and returns a new Form . |
getActiveForm() | Form | Returns the form to which the script is container-bound. |
getUi() | Ui | Returns an instance of the form editor's user-interface environment that allows the script to add features like menus, dialogs, and sidebars. |
openById(id) | Form | Returns the Form with the specified ID. |
openByUrl(url) | Form | Returns the Form with the specified URL. |
Class FormResponse
Methods
Method | Return type | Brief description |
---|---|---|
getEditResponseUrl() | String | Generates a URL that can be used to edit a response that has already been submitted, even if
the Form.setAllowResponseEdits(enabled) setting is disabled. |
getId() | String | Gets the ID of the form response. |
getItemResponses() | ItemResponse[] | Gets all item responses contained in this form response, in the same order as the items appear in the form. |
getRespondentEmail() | String | Gets the email address of the person who submitted this response, if the
Form.setCollectEmail(collect) setting is enabled. |
getResponseForItem(item) | ItemResponse | Gets the item response contained in this form response for a given item. |
getTimestamp() | Date | Gets the timestamp at which this response was submitted. |
submit() | FormResponse | Submits the response. |
toPrefilledUrl() | String | Generates a URL for the form in which the answers are pre-filled based on the answers in this form response. |
withItemResponse(response) | FormResponse | Adds an item response to this form response. |
Class GridItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(responses) | ItemResponse | Creates a new ItemResponse for this grid item. |
duplicate() | GridItem | Creates a copy of this item and appends it to the end of the form. |
getColumns() | String[] | Gets the values for every column in the grid. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getRows() | String[] | Gets the values for every row in the grid. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setColumns(columns) | GridItem | Sets the columns of the grid based on an array of values. |
setHelpText(text) | GridItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setRequired(enabled) | GridItem | Sets whether the respondent must answer the question. |
setRows(rows) | GridItem | Sets the rows of the grid based on an array of values. |
setTitle(title) | GridItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class ImageItem
Methods
Method | Return type | Brief description |
---|---|---|
duplicate() | ImageItem | Creates a copy of this item and appends it to the end of the form. |
getAlignment() | Alignment | Gets the image's horizontal alignment. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getImage() | Blob | Gets the image that is currently assigned to the item. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
getWidth() | Integer | Gets the image's width in pixels. |
setAlignment(alignment) | ImageItem | Sets the image's horizontal alignment. |
setHelpText(text) | ImageItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setImage(image) | ImageItem | Sets the image itself. |
setTitle(title) | ImageItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
setWidth(width) | ImageItem | Sets the image's width in pixels. |
Class Item
Methods
Method | Return type | Brief description |
---|---|---|
asCheckboxItem() | CheckboxItem | Returns the item as a checkbox item. |
asDateItem() | DateItem | Returns the item as a date item. |
asDateTimeItem() | DateTimeItem | Returns the item as a date-time item. |
asDurationItem() | DurationItem | Returns the item as a duration item. |
asGridItem() | GridItem | Returns the item as a grid item. |
asImageItem() | ImageItem | Returns the item as an image item. |
asListItem() | ListItem | Returns the item as a list item. |
asMultipleChoiceItem() | MultipleChoiceItem | Returns the item as a multiple-choice item. |
asPageBreakItem() | PageBreakItem | Returns the item as a page-break item. |
asParagraphTextItem() | ParagraphTextItem | Returns the item as a paragraph-text item. |
asScaleItem() | ScaleItem | Returns the item as a scale item. |
asSectionHeaderItem() | SectionHeaderItem | Returns the item as a section-header item. |
asTextItem() | TextItem | Returns the item as a text item. |
asTimeItem() | TimeItem | Returns the item as a time item. |
asVideoItem() | VideoItem | Returns the item as a video item. |
duplicate() | Item | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
setHelpText(text) | Item | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setTitle(title) | Item | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class ItemResponse
Methods
Method | Return type | Brief description |
---|---|---|
getItem() | Item | Gets the question item that this response answers. |
getResponse() | Object | Gets the answer that the respondent submitted. |
Class ItemType
Properties
Property | Type | Description |
---|---|---|
CHECKBOX | Enum | A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. |
DATE | Enum | A question item that allows the respondent to indicate a date. |
DATETIME | Enum | A question item that allows the respondent to indicate a date and time. |
DURATION | Enum | A question item that allows the respondent to indicate a length of time. |
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. |
IMAGE | Enum | A layout item that displays an image. |
LIST | Enum | A question item that allows the respondent to select one choice from a drop-down list. |
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. |
PAGE_BREAK | Enum | A layout item that marks the start of a page. |
PARAGRAPH_TEXT | Enum | A question item that allows the respondent to enter a block of text. |
SCALE | Enum | A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |
SECTION_HEADER | Enum | A layout item that visually indicates the start of a section. |
TEXT | Enum | A question item that allows the respondent to enter a single line of text. |
TIME | Enum | A question item that allows the respondent to indicate a time of day. |
Class ListItem
Methods
Method | Return type | Brief description |
---|---|---|
createChoice(value) | Choice | Creates a new choice. |
createChoice(value, navigationItem) | Choice | Creates a new choice with a page-navigation option that jumps to a given page-break item. |
createChoice(value, navigationType) | Choice | Creates a new choice with a page-navigation option. |
createResponse(response) | ItemResponse | Creates a new ItemResponse for this list item. |
duplicate() | ListItem | Creates a copy of this item and appends it to the end of the form. |
getChoices() | Choice[] | Gets all choices for an item. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setChoiceValues(values) | ListItem | Sets the choices for an item from an array of strings. |
setChoices(choices) | ListItem | Sets an array of choices for an item. |
setHelpText(text) | ListItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setRequired(enabled) | ListItem | Sets whether the respondent must answer the question. |
setTitle(title) | ListItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class MultipleChoiceItem
Methods
Method | Return type | Brief description |
---|---|---|
createChoice(value) | Choice | Creates a new choice. |
createChoice(value, navigationItem) | Choice | Creates a new choice with a page-navigation option that jumps to a given page-break item. |
createChoice(value, navigationType) | Choice | Creates a new choice with a page-navigation option. |
createResponse(response) | ItemResponse | Creates a new ItemResponse for this multiple-choice item. |
duplicate() | MultipleChoiceItem | Creates a copy of this item and appends it to the end of the form. |
getChoices() | Choice[] | Gets all choices for an item. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
hasOtherOption() | Boolean | Determines whether the item has an "other" option. |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setChoiceValues(values) | MultipleChoiceItem | Sets the choices for an item from an array of strings. |
setChoices(choices) | MultipleChoiceItem | Sets an array of choices for an item. |
setHelpText(text) | MultipleChoiceItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setRequired(enabled) | MultipleChoiceItem | Sets whether the respondent must answer the question. |
setTitle(title) | MultipleChoiceItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
showOtherOption(enabled) | MultipleChoiceItem | Sets whether the item has an "other" option. |
Class PageBreakItem
Methods
Method | Return type | Brief description |
---|---|---|
duplicate() | PageBreakItem | Creates a copy of this item and appends it to the end of the form. |
getGoToPage() | PageBreakItem | Gets the PageBreakItem that the form will jump to after completing the page before this
page break (that is, upon reaching this page break by normal linear progression through the
form). |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getPageNavigationType() | PageNavigationType | Gets the type of page navigation that occurs after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
setGoToPage(goToPageItem) | PageBreakItem | Sets the page to jump to after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). |
setGoToPage(navigationType) | PageBreakItem | Sets the type of page navigation that occurs after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). |
setHelpText(text) | PageBreakItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setTitle(title) | PageBreakItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class PageNavigationType
Properties
Property | Type | Description |
---|---|---|
CONTINUE | Enum | Continue to the next page of the form after completing the current page. |
GO_TO_PAGE | Enum | Jump to a specified page of the form after completing the current page. |
RESTART | Enum | Restart the form from the beginning, without clearing answers entered so far, after completing the current page. |
SUBMIT | Enum | Submit the form response after completing the current page. |
Class ParagraphTextItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(response) | ItemResponse | Creates a new ItemResponse for this paragraph text item. |
duplicate() | ParagraphTextItem | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setHelpText(text) | ParagraphTextItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setRequired(enabled) | ParagraphTextItem | Sets whether the respondent must answer the question. |
setTitle(title) | ParagraphTextItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class ScaleItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(response) | ItemResponse | Creates a new ItemResponse for this scale item. |
duplicate() | ScaleItem | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getLeftLabel() | String | Gets the label for the scale's lower bound, if any. |
getLowerBound() | Integer | Gets the scale's lower bound. |
getRightLabel() | String | Gets the label for the scale's upper bound, if any. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
getUpperBound() | Integer | Gets the scale's upper bound. |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setBounds(lower, upper) | ScaleItem | Sets the scale's lower and upper bounds. |
setHelpText(text) | ScaleItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setLabels(lower, upper) | ScaleItem | Sets labels for the scale's lower and upper bounds. |
setRequired(enabled) | ScaleItem | Sets whether the respondent must answer the question. |
setTitle(title) | ScaleItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class SectionHeaderItem
Methods
Method | Return type | Brief description |
---|---|---|
duplicate() | SectionHeaderItem | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
setHelpText(text) | SectionHeaderItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setTitle(title) | SectionHeaderItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class TextItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(response) | ItemResponse | Creates a new ItemResponse for this text item. |
duplicate() | TextItem | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setHelpText(text) | TextItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setRequired(enabled) | TextItem | Sets whether the respondent must answer the question. |
setTitle(title) | TextItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class TimeItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(hour, minute) | ItemResponse | Creates a new ItemResponse for this time item. |
duplicate() | TimeItem | Creates a copy of this item and appends it to the end of the form. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setHelpText(text) | TimeItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setRequired(enabled) | TimeItem | Sets whether the respondent must answer the question. |
setTitle(title) | TimeItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
Class VideoItem
Methods
Method | Return type | Brief description |
---|---|---|
duplicate() | VideoItem | Creates a copy of this item and appends it to the end of the form. |
getAlignment() | Alignment | Gets the video's horizontal alignment. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
getWidth() | Integer | Gets the video's width in pixels. |
setAlignment(alignment) | VideoItem | Sets the video's horizontal alignment. |
setHelpText(text) | VideoItem | Sets the item's help text (sometimes called description text for layout
items like ImageItems ,
PageBreakItems , and
SectionHeaderItems ). |
setTitle(title) | VideoItem | Sets the item's title (sometimes called header text, in the case of a
SectionHeaderItem ). |
setVideoUrl(youtubeUrl) | VideoItem | Sets the video itself from a given YouTube URL or YouTube video ID. |
setWidth(width) | VideoItem | Sets the video's width in pixels. |