Google Apps Script

Forms Service

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

NameBrief description
AlignmentAn enum representing the supported types of image alignment.
CheckboxItemA question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field.
ChoiceA single choice associated with a type of Item that supports choices, like CheckboxItem, ListItem, or MultipleChoiceItem.
DateItemA question item that allows the respondent to indicate a date.
DateTimeItemA question item that allows the respondent to indicate a date and time.
DestinationTypeAn enum representing the supported types of form-response destinations.
DurationItemA question item that allows the respondent to indicate a length of time.
FormA 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).
FormAppAllows a script to open existing Forms or create new ones.
FormResponseA response to the form as a whole.
GridItemA 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.
ImageItemA layout item that displays an image.
ItemA generic form item that contains properties common to all items, such as title and help text.
ItemResponseA response to one question item within a form.
ItemTypeAn enum representing the supported types of form items.
ListItemA question item that allows the respondent to select one choice from a drop-down list.
MultipleChoiceItemA question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field.
PageBreakItemA layout item that marks the start of a page.
PageNavigationTypeAn enum representing the supported types of page navigation.
ParagraphTextItemA question item that allows the respondent to enter a block of text.
ScaleItemA question item that allows the respondent to choose one option from a numbered sequence of radio buttons.
SectionHeaderItemA layout item that visually indicates the start of a section.
TextItemA question item that allows the respondent to enter a single line of text.
TimeItemA question item that allows the respondent to indicate a time of day.
VideoItemA layout item that displays a video.

Class Alignment

Properties

PropertyTypeDescription
LEFTEnumAlign the image to the left side of the form.
CENTEREnumAlign the image to the center of the form.
RIGHTEnumAlign the image to the right side of the form.

Class CheckboxItem

Methods

MethodReturn typeBrief description
createChoice(value)ChoiceCreates a new choice.
createResponse(responses)ItemResponseCreates a new ItemResponse for this checkbox item.
duplicate()CheckboxItemCreates a copy of this item and appends it to the end of the form.
getChoices()Choice[]Gets all choices for an item.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
hasOtherOption()BooleanDetermines whether the item has an "other" option.
isRequired()BooleanDetermines whether the respondent must answer the question.
setChoiceValues(values)CheckboxItemSets the choices for an item from an array of strings.
setChoices(choices)CheckboxItemSets an array of choices for an item.
setHelpText(text)CheckboxItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setRequired(enabled)CheckboxItemSets whether the respondent must answer the question.
setTitle(title)CheckboxItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
showOtherOption(enabled)CheckboxItemSets whether the item has an "other" option.

Class Choice

Methods

MethodReturn typeBrief description
getGotoPage()PageBreakItemGets the PageBreakItem set as a GO_TO_PAGE destination if the responder selects this choice and completes the current page.
getPageNavigationType()PageNavigationTypeGets the PageNavigationType that occurs if the responder selects this choice and completes the current page.
getValue()StringGets the choice's value, which respondents see as a label when viewing the form.

Class DateItem

Methods

MethodReturn typeBrief description
createResponse(response)ItemResponseCreates a new ItemResponse for this date item.
duplicate()DateItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
includesYear()BooleanDetermines whether the date item includes a year option.
isRequired()BooleanDetermines whether the respondent must answer the question.
setHelpText(text)DateItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setIncludesYear(enableYear)DateItemSets whether the date item includes a year setting.
setRequired(enabled)DateItemSets whether the respondent must answer the question.
setTitle(title)DateItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class DateTimeItem

Methods

MethodReturn typeBrief description
createResponse(response)ItemResponseCreates a new ItemResponse for this date-time item.
duplicate()DateTimeItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
includesYear()BooleanDetermines whether the date item includes a year option.
isRequired()BooleanDetermines whether the respondent must answer the question.
setHelpText(text)DateTimeItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setIncludesYear(enableYear)DateTimeItemSets whether the date item includes a year setting.
setRequired(enabled)DateTimeItemSets whether the respondent must answer the question.
setTitle(title)DateTimeItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class DestinationType

Properties

PropertyTypeDescription
SPREADSHEETEnumA Google Sheets spreadsheet as a destination for form responses.

Class DurationItem

Methods

MethodReturn typeBrief description
createResponse(hours, minutes, seconds)ItemResponseCreates a new ItemResponse for this date item.
duplicate()DurationItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
isRequired()BooleanDetermines whether the respondent must answer the question.
setHelpText(text)DurationItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setRequired(enabled)DurationItemSets whether the respondent must answer the question.
setTitle(title)DurationItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class Form

Methods

MethodReturn typeBrief description
addCheckboxItem()CheckboxItemAppends a new question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field.
addDateItem()DateItemAppends a new question item that allows the respondent to indicate a date.
addDateTimeItem()DateTimeItemAppends a new question item that allows the respondent to indicate a date and time.
addDurationItem()DurationItemAppends a new question item that allows the respondent to indicate a length of time.
addEditor(emailAddress)FormAdds the given user to the list of editors for the Form.
addEditor(user)FormAdds the given user to the list of editors for the Form.
addEditors(emailAddresses)FormAdds the given array of users to the list of editors for the Form.
addGridItem()GridItemAppends 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()ImageItemAppends a new layout item that displays an image.
addListItem()ListItemAppends a new question item that allows the respondent to select one choice from a drop-down list.
addMultipleChoiceItem()MultipleChoiceItemAppends a new question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field.
addPageBreakItem()PageBreakItemAppends a new layout item that marks the start of a page.
addParagraphTextItem()ParagraphTextItemAppends a new question item that allows the respondent to enter a block of text.
addScaleItem()ScaleItemAppends a new question item that allows the respondent to choose one option from a numbered sequence of radio buttons.
addSectionHeaderItem()SectionHeaderItemAppends a new layout item that visually indicates the start of a section.
addTextItem()TextItemAppends a new question item that allows the respondent to enter a single line of text.
addTimeItem()TimeItemAppends a new question item that allows the respondent to indicate a time of day.
addVideoItem()VideoItemAppends a new layout item that displays a video.
canEditResponse()BooleanDetermines whether the form displays a link to edit a response after submitting it.
collectsEmail()BooleanDetermines whether the form collects respondents' email addresses.
createResponse()FormResponseCreates a new response to the form.
deleteAllResponses()FormDeletes all submitted responses from the form's response store.
deleteItem(index)voidDeletes the item at a given index among all the items in the form.
deleteItem(item)voidDeletes the given item.
getConfirmationMessage()StringGets the form's confirmation message.
getCustomClosedFormMessage()StringGets 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()StringGets the form's description.
getDestinationId()StringGets the ID of the form's response destination.
getDestinationType()DestinationTypeGets the type of the form's response destination.
getEditUrl()StringGets the URL that can be used to access the form's edit mode.
getEditors()User[]Gets the list of editors for this Form.
getId()StringGets the ID of the form.
getItemById(id)ItemGets 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()StringGets the URL that can be used to respond to the form.
getResponse(responseId)FormResponseGets 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.
getSummaryUrl()StringGets the URL that can be used to view a summary of the form's responses.
getTitle()StringGets the form's title.
hasProgressBar()BooleanDetermines whether the form displays a progress bar.
hasRespondAgainLink()BooleanDetermines whether the form displays a link to submit another response after a respondent completes the form.
isAcceptingResponses()BooleanDetermines whether the form is currently accepting responses.
isPublishingSummary()BooleanDetermines whether the form displays a link to view a summary of responses after a respondent completes the form.
moveItem(from, to)ItemMoves an item at a given index among all the items in the form to another given index.
moveItem(item, toIndex)ItemMoves a given item to an given index among all the items in the form.
removeDestination()FormUnlinks the form from its current response destination.
removeEditor(emailAddress)FormRemoves the given user from the list of editors for the Form.
removeEditor(user)FormRemoves the given user from the list of editors for the Form.
requiresLogin()BooleanDetermines whether the form requires respondents to log in to an account in the same domain or a subdomain before responding.
setAcceptingResponses(enabled)FormSets whether the form is currently accepting responses.
setAllowResponseEdits(enabled)FormSets whether the form displays a link to edit a response after submitting it.
setCollectEmail(collect)FormSets whether the form collects respondents' email addresses.
setConfirmationMessage(message)FormSets the form's confirmation message.
setCustomClosedFormMessage(message)FormSets the message to display if the form is not accepting responses.
setDescription(description)FormSets the form's description.
setDestination(type, id)FormSets the destination where form responses are saved.
setProgressBar(enabled)FormSets whether the form has a progress bar.
setPublishingSummary(enabled)FormSets whether the form displays a link to view a summary of responses after a respondent submits the form.
setRequireLogin(requireLogin)FormSets whether the form requires respondents to log in to an account in the same domain or a subdomain before responding.
setShowLinkToRespondAgain(enabled)FormSets whether the form displays a link to submit another response after a respondent completes the form.
setTitle(title)FormSets the form's title.

Class FormApp

Properties

PropertyTypeDescription
AlignmentAlignmentAn enumeration of types of image alignment.
DestinationTypeDestinationTypeAn enumeration of types of destinations that can store form responses.
ItemTypeItemTypeAn enumeration of types of form Items.
PageNavigationTypePageNavigationTypeAn enumeration of possible behaviors for navigating pages.

Methods

MethodReturn typeBrief description
create(title)FormCreates and returns a new Form.
getActiveForm()FormReturns the form to which the script is container-bound.
getUi()UiReturns an instance of the form editor's user-interface environment that allows the script to add features like menus, dialogs, and sidebars.
openById(id)FormReturns the Form with the specified ID.
openByUrl(url)FormReturns the Form with the specified URL.

Class FormResponse

Methods

MethodReturn typeBrief description
getEditResponseUrl()StringGenerates 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()StringGets 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()StringGets the email address of the person who submitted this response, if the Form.setCollectEmail(collect) setting is enabled.
getResponseForItem(item)ItemResponseGets the item response contained in this form response for a given item.
getTimestamp()DateGets the timestamp at which this response was submitted.
submit()FormResponseSubmits the response.
toPrefilledUrl()StringGenerates a URL for the form in which the answers are pre-filled based on the answers in this form response.
withItemResponse(response)FormResponseAdds an item response to this form response.

Class GridItem

Methods

MethodReturn typeBrief description
createResponse(responses)ItemResponseCreates a new ItemResponse for this grid item.
duplicate()GridItemCreates 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()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getRows()String[]Gets the values for every row in the grid.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
isRequired()BooleanDetermines whether the respondent must answer the question.
setColumns(columns)GridItemSets the columns of the grid based on an array of values.
setHelpText(text)GridItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setRequired(enabled)GridItemSets whether the respondent must answer the question.
setRows(rows)GridItemSets the rows of the grid based on an array of values.
setTitle(title)GridItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class ImageItem

Methods

MethodReturn typeBrief description
duplicate()ImageItemCreates a copy of this item and appends it to the end of the form.
getAlignment()AlignmentGets the image's horizontal alignment.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getImage()BlobGets the image that is currently assigned to the item.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
getWidth()IntegerGets the image's width in pixels.
setAlignment(alignment)ImageItemSets the image's horizontal alignment.
setHelpText(text)ImageItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setImage(image)ImageItemSets the image itself.
setTitle(title)ImageItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
setWidth(width)ImageItemSets the image's width in pixels.

Class Item

Methods

MethodReturn typeBrief description
asCheckboxItem()CheckboxItemReturns the item as a checkbox item.
asDateItem()DateItemReturns the item as a date item.
asDateTimeItem()DateTimeItemReturns the item as a date-time item.
asDurationItem()DurationItemReturns the item as a duration item.
asGridItem()GridItemReturns the item as a grid item.
asImageItem()ImageItemReturns the item as an image item.
asListItem()ListItemReturns the item as a list item.
asMultipleChoiceItem()MultipleChoiceItemReturns the item as a multiple-choice item.
asPageBreakItem()PageBreakItemReturns the item as a page-break item.
asParagraphTextItem()ParagraphTextItemReturns the item as a paragraph-text item.
asScaleItem()ScaleItemReturns the item as a scale item.
asSectionHeaderItem()SectionHeaderItemReturns the item as a section-header item.
asTextItem()TextItemReturns the item as a text item.
asTimeItem()TimeItemReturns the item as a time item.
asVideoItem()VideoItemReturns the item as a video item.
duplicate()ItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
setHelpText(text)ItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setTitle(title)ItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class ItemResponse

Methods

MethodReturn typeBrief description
getItem()ItemGets the question item that this response answers.
getResponse()ObjectGets the answer that the respondent submitted.

Class ItemType

Properties

PropertyTypeDescription
CHECKBOXEnumA question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field.
DATEEnumA question item that allows the respondent to indicate a date.
DATETIMEEnumA question item that allows the respondent to indicate a date and time.
DURATIONEnumA question item that allows the respondent to indicate a length of time.
GRIDEnumA 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.
IMAGEEnumA layout item that displays an image.
LISTEnumA question item that allows the respondent to select one choice from a drop-down list.
MULTIPLE_CHOICEEnumA question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field.
PAGE_BREAKEnumA layout item that marks the start of a page.
PARAGRAPH_TEXTEnumA question item that allows the respondent to enter a block of text.
SCALEEnumA question item that allows the respondent to choose one option from a numbered sequence of radio buttons.
SECTION_HEADEREnumA layout item that visually indicates the start of a section.
TEXTEnumA question item that allows the respondent to enter a single line of text.
TIMEEnumA question item that allows the respondent to indicate a time of day.

Class ListItem

Methods

MethodReturn typeBrief description
createChoice(value)ChoiceCreates a new choice.
createChoice(value, navigationItem)ChoiceCreates a new choice with a page-navigation option that jumps to a given page-break item.
createChoice(value, navigationType)ChoiceCreates a new choice with a page-navigation option.
createResponse(response)ItemResponseCreates a new ItemResponse for this list item.
duplicate()ListItemCreates a copy of this item and appends it to the end of the form.
getChoices()Choice[]Gets all choices for an item.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
isRequired()BooleanDetermines whether the respondent must answer the question.
setChoiceValues(values)ListItemSets the choices for an item from an array of strings.
setChoices(choices)ListItemSets an array of choices for an item.
setHelpText(text)ListItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setRequired(enabled)ListItemSets whether the respondent must answer the question.
setTitle(title)ListItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class MultipleChoiceItem

Methods

MethodReturn typeBrief description
createChoice(value)ChoiceCreates a new choice.
createChoice(value, navigationItem)ChoiceCreates a new choice with a page-navigation option that jumps to a given page-break item.
createChoice(value, navigationType)ChoiceCreates a new choice with a page-navigation option.
createResponse(response)ItemResponseCreates a new ItemResponse for this multiple-choice item.
duplicate()MultipleChoiceItemCreates a copy of this item and appends it to the end of the form.
getChoices()Choice[]Gets all choices for an item.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
hasOtherOption()BooleanDetermines whether the item has an "other" option.
isRequired()BooleanDetermines whether the respondent must answer the question.
setChoiceValues(values)MultipleChoiceItemSets the choices for an item from an array of strings.
setChoices(choices)MultipleChoiceItemSets an array of choices for an item.
setHelpText(text)MultipleChoiceItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setRequired(enabled)MultipleChoiceItemSets whether the respondent must answer the question.
setTitle(title)MultipleChoiceItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
showOtherOption(enabled)MultipleChoiceItemSets whether the item has an "other" option.

Class PageBreakItem

Methods

MethodReturn typeBrief description
duplicate()PageBreakItemCreates a copy of this item and appends it to the end of the form.
getGoToPage()PageBreakItemGets 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()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getPageNavigationType()PageNavigationTypeGets 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()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
setGoToPage(goToPageItem)PageBreakItemSets 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)PageBreakItemSets 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)PageBreakItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setTitle(title)PageBreakItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class PageNavigationType

Properties

PropertyTypeDescription
CONTINUEEnumContinue to the next page of the form after completing the current page.
GO_TO_PAGEEnumJump to a specified page of the form after completing the current page.
RESTARTEnumRestart the form from the beginning, without clearing answers entered so far, after completing the current page.
SUBMITEnumSubmit the form response after completing the current page.

Class ParagraphTextItem

Methods

MethodReturn typeBrief description
createResponse(response)ItemResponseCreates a new ItemResponse for this paragraph text item.
duplicate()ParagraphTextItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
isRequired()BooleanDetermines whether the respondent must answer the question.
setHelpText(text)ParagraphTextItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setRequired(enabled)ParagraphTextItemSets whether the respondent must answer the question.
setTitle(title)ParagraphTextItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class ScaleItem

Methods

MethodReturn typeBrief description
createResponse(response)ItemResponseCreates a new ItemResponse for this scale item.
duplicate()ScaleItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getLeftLabel()StringGets the label for the scale's lower bound, if any.
getLowerBound()IntegerGets the scale's lower bound.
getRightLabel()StringGets the label for the scale's upper bound, if any.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
getUpperBound()IntegerGets the scale's upper bound.
isRequired()BooleanDetermines whether the respondent must answer the question.
setBounds(lower, upper)ScaleItemSets the scale's lower and upper bounds.
setHelpText(text)ScaleItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setLabels(lower, upper)ScaleItemSets labels for the scale's lower and upper bounds.
setRequired(enabled)ScaleItemSets whether the respondent must answer the question.
setTitle(title)ScaleItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class SectionHeaderItem

Methods

MethodReturn typeBrief description
duplicate()SectionHeaderItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
setHelpText(text)SectionHeaderItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setTitle(title)SectionHeaderItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class TextItem

Methods

MethodReturn typeBrief description
createResponse(response)ItemResponseCreates a new ItemResponse for this text item.
duplicate()TextItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
isRequired()BooleanDetermines whether the respondent must answer the question.
setHelpText(text)TextItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setRequired(enabled)TextItemSets whether the respondent must answer the question.
setTitle(title)TextItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class TimeItem

Methods

MethodReturn typeBrief description
createResponse(hour, minute)ItemResponseCreates a new ItemResponse for this time item.
duplicate()TimeItemCreates a copy of this item and appends it to the end of the form.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
isRequired()BooleanDetermines whether the respondent must answer the question.
setHelpText(text)TimeItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setRequired(enabled)TimeItemSets whether the respondent must answer the question.
setTitle(title)TimeItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).

Class VideoItem

Methods

MethodReturn typeBrief description
duplicate()VideoItemCreates a copy of this item and appends it to the end of the form.
getAlignment()AlignmentGets the video's horizontal alignment.
getHelpText()StringGets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
getId()IntegerGets the item's unique identifier.
getIndex()IntegerGets the index of the item among all the items in the form.
getTitle()StringGets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
getType()ItemTypeGets the item's type, represented as an ItemType.
getWidth()IntegerGets the video's width in pixels.
setAlignment(alignment)VideoItemSets the video's horizontal alignment.
setHelpText(text)VideoItemSets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems).
setTitle(title)VideoItemSets the item's title (sometimes called header text, in the case of a SectionHeaderItem).
setVideoUrl(youtubeUrl)VideoItemSets the video itself from a given YouTube URL or YouTube video ID.
setWidth(width)VideoItemSets the video's width in pixels.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.