Forms Service

Forms

This service allows scripts to create, access, and modify Google Forms.

 // 
  
 Create 
  
 a 
  
 new 
  
 unpublished 
  
 form 
 , 
  
 then 
  
 add 
  
 a 
  
 checkbox 
  
 question 
 , 
  
 a 
  
 multiple 
  
 choice 
  
 question 
 , 
 // 
  
 a 
  
 page 
  
 break 
 , 
  
 then 
  
 a 
  
 date 
  
 question 
  
 and 
  
 a 
  
 grid 
  
 of 
  
 questions 
 , 
  
 then 
  
 publish 
  
 the 
  
 form 
  
 and 
  
 share 
 // 
  
 with 
  
 responders 
 . 
 var 
  
 form 
  
 = 
  
 FormApp 
 . 
 create 
 ( 
 'New Form' 
 , 
  
 /* 
  
 isPublished 
 = 
  
 */ 
  
 false 
 ); 
 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' 
 ]); 
 form 
 . 
 setPublished 
 ( 
 true 
 ); 
 form 
 . 
 addPublishedReaders 
 ([ 
 'user@example.com' 
 , 
  
 'group@example.com' 
 ]); 
 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.
Checkbox Grid Item 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.
Checkbox Grid Validation A DataValidation for a Checkbox Grid Item .
Checkbox Grid Validation Builder A DataValidationBuilder for a Checkbox Grid Validation .
Checkbox Item A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field.
Checkbox Validation A DataValidation for a Checkbox Item .
Checkbox Validation Builder A DataValidationBuilder for a Checkbox Validation .
Choice A single choice associated with a type of Item that supports choices, like Checkbox Item , List Item , or Multiple Choice Item .
Date Item A question item that allows the respondent to indicate a date.
Date Time Item A question item that allows the respondent to indicate a date and time.
Destination Type An enum representing the supported types of form-response destinations.
Duration Item A question item that allows the respondent to indicate a length of time.
Feedback Type An enum representing the supported types of feedback.
Form A form that contains overall properties and items.
Form App Allows a script to open an existing Form or create a new one.
Form Response A response to the form as a whole.
Grid Item 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.
Grid Validation A DataValidation for a Grid Item .
Grid Validation Builder A DataValidationBuilder for a Grid Validation .
Image Item 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.
Item Response A response to one question item within a form.
Item Type An enum representing the supported types of form items.
List Item A question item that allows the respondent to select one choice from a drop-down list.
Multiple Choice Item A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field.
Page Break Item A layout item that marks the start of a page.
Page Navigation Type An enum representing the supported types of page navigation.
Paragraph Text Item A question item that allows the respondent to enter a block of text.
Paragraph Text Validation A DataValidation for a Paragraph Text Item .
Paragraph Text Validation Builder A DataValidationBuilder for a Paragraph Text Validation .
Quiz Feedback The bean implementation of a Feedback, which contains properties common to all feedback, such as display text or links.
Quiz Feedback Builder The base FeedbackBuilder that contains setters for properties common to all feedback, such as display text.
Rating Icon Type An enum representing the supported types of rating icons.
Rating Item A question item that allows the respondent to give a rating.
Scale Item A question item that allows the respondent to choose one option from a numbered sequence of radio buttons.
Section Header Item A layout item that visually indicates the start of a section.
Text Item A question item that allows the respondent to enter a single line of text.
Text Validation A DataValidation for a Text Item .
Text Validation Builder A DataValidationBuilder for a Text Validation .
Time Item A question item that allows the respondent to indicate a time of day.
Video Item A layout item that displays a video.

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.

Checkbox Grid Item

Methods

Method Return type Brief description
Checkbox Grid Item Removes any data validation for this grid item.
Item Response Creates a new Item Response for this checkbox grid item.
Checkbox Grid Item Creates a copy of this item and appends it to the end of the form.
String[] Gets the values for every column in the grid.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
String[] Gets the values for every row in the grid.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the respondent must answer the question.
Checkbox Grid Item Sets the columns of the grid based on an array of values.
Checkbox Grid Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Checkbox Grid Item Sets whether the respondent must answer the question.
Checkbox Grid Item Sets the rows of the grid based on an array of values.
Checkbox Grid Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).
Checkbox Grid Item Sets the data validation for this checkbox grid item.

Checkbox Grid Validation

Checkbox Grid Validation Builder

Methods

Method Return type Brief description
Checkbox Grid Validation Builder Requires limit of one response per column for a grid item.

Checkbox Item

Methods

Method Return type Brief description
Checkbox Item Removes any data validation for this checkbox item.
Choice Creates a new choice.
Choice Creates a new choice.
Item Response Creates a new Item Response for this checkbox item.
Checkbox Item Creates a copy of this item and appends it to the end of the form.
Choice[] Gets all choices for an item.
Quiz Feedback Returns the feedback that is shown to respondents when they respond correctly to a question.
Quiz Feedback Returns the feedback that is shown to respondents when they respond incorrectly to a question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the item has an "other" option.
Boolean Determines whether the respondent must answer the question.
Checkbox Item Sets the choices for an item from an array of strings.
Checkbox Item Sets an array of choices for an item.
Checkbox Item Sets the feedback to be shown to respondents when they respond correctly to a question.
Checkbox Item Sets the feedback to be shown to respondents when they respond incorrectly to a question.
Checkbox Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Checkbox Item Sets the number of points a gradeable item is worth.
Checkbox Item Sets whether the respondent must answer the question.
Checkbox Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).
Checkbox Item Sets the data validation for this checkbox item.
Checkbox Item Sets whether the item has an "other" option.

Checkbox Validation

Checkbox Validation Builder

Methods

Method Return type Brief description
Checkbox Validation Builder Require at least this many choices to be selected.
Checkbox Validation Builder Require at most this many choices to be selected.
Checkbox Validation Builder Require exactly this many choices to be selected.

Choice

Methods

Method Return type Brief description
Page Break Item Gets the Page Break Item set as a GO_TO_PAGE destination if the responder selects this choice and completes the current page.
Page Navigation Type Gets the Page Navigation Type that occurs if the responder selects this choice and completes the current page.
String Gets the choice's value, which respondents see as a label when viewing the form.
Boolean Gets whether the choice is a correct answer for the question.

Date Item

Methods

Method Return type Brief description
Item Response Creates a new Item Response for this date item.
Date Item Creates a copy of this item and appends it to the end of the form.
Quiz Feedback Returns the feedback that is shown to respondents when they respond to a gradeable question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the date item includes a year option.
Boolean Determines whether the respondent must answer the question.
Date Item Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading).
Date Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Date Item Sets whether the date item includes a year setting.
Date Item Sets the number of points a gradeable item is worth.
Date Item Sets whether the respondent must answer the question.
Date Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Date Time Item

Methods

Method Return type Brief description
Item Response Creates a new Item Response for this date-time item.
Date Time Item Creates a copy of this item and appends it to the end of the form.
Quiz Feedback Returns the feedback that is shown to respondents when they respond to a gradeable question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the date item includes a year option.
Boolean Determines whether the respondent must answer the question.
Date Time Item Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading).
Date Time Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Date Time Item Sets whether the date item includes a year setting.
Date Time Item Sets the number of points a gradeable item is worth.
Date Time Item Sets whether the respondent must answer the question.
Date Time Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Destination Type

Properties

Property Type Description
SPREADSHEET
Enum A Google Sheets spreadsheet as a destination for form responses.

Duration Item

Methods

Method Return type Brief description
Item Response Creates a new Item Response for this date item.
Duration Item Creates a copy of this item and appends it to the end of the form.
Quiz Feedback Returns the feedback that is shown to respondents when they respond to a gradeable question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the respondent must answer the question.
Duration Item Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading).
Duration Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Duration Item Sets the number of points a gradeable item is worth.
Duration Item Sets whether the respondent must answer the question.
Duration Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Feedback Type

Properties

Property Type Description
CORRECT
Enum Feedback that is automatically displayed to respondents for a question answered correctly.
INCORRECT
Enum Feedback that is automatically displayed to respondents for a question answered incorrectly.
GENERAL
Enum Feedback that is automatically displayed to respondents when they submit their response.

Form

Methods

Method Return type Brief description
Checkbox Grid Item Appends a new 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.
Checkbox Item Appends a new question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field.
Date Item Appends a new question item that allows the respondent to indicate a date.
Date Time Item Appends a new question item that allows the respondent to indicate a date and time.
Duration Item Appends a new question item that allows the respondent to indicate a length of time.
Form Adds the given user to the list of editors for the Form .
Form Adds the given user to the list of editors for the Form .
Form Adds the given array of users to the list of editors for the Form .
Grid Item 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.
Image Item Appends a new layout item that displays an image.
List Item Appends a new question item that allows the respondent to select one choice from a dropdown list.
Multiple Choice Item Adds a new question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field.
Page Break Item Adds a new layout item that marks the start of a page.
Paragraph Text Item Adds a new question item that allows the respondent to enter a block of text.
Form Adds the given user to the list of responders for the Form .
Form Adds the given user to the list of responders for the Form .
Form Adds the given array of users to the list of responders for the Form .
Rating Item Appends a new question item that allows the respondent to give a rating.
Scale Item Appends a new question item that allows the respondent to choose one option from a numbered sequence of radio buttons.
Section Header Item Appends a new layout item that visually indicates the start of a section.
Text Item Appends a new question item that allows the respondent to enter a single line of text.
Time Item Appends a new question item that allows the respondent to indicate a time of day.
Video Item Appends a new layout item that displays a video.
Boolean Determines whether the form displays a link to edit a response after submitting it.
Boolean Determines whether the form collects respondents' email addresses.
Form Response Creates a new response to the form.
Form Deletes all submitted responses from the form's response store.
void Deletes the item at a given index among all the items in the form.
void Deletes the given item.
Form Deletes a single response from the form's response store.
String Gets the form's confirmation message.
String Gets the custom message that is displayed if the form is not accepting responses, or an empty string if no custom message is set.
String Gets the form's description.
String Gets the ID of the form's response destination.
Destination Type Gets the type of the form's response destination.
String Gets the URL that can be used to access the form's edit mode.
User[] Gets the list of editors for this Form .
String Gets the ID of the form.
Item Gets the item with a given ID.
Item[] Gets an array of all items in the form.
Item[] Gets an array of all items of a given type.
User[] Gets the list of responders for this Form .
String Gets the URL that can be used to respond to the form.
Form Response Gets a single form response based on its response ID.
Form Response[] Gets an array of all of the form's responses.
Form Response[] Gets an array of all of the form's responses after a given date and time.
Boolean Determines whether the order of the questions on each page of the form is randomized.
String Gets the URL that can be used to view a summary of the form's responses.
String Gets the form's title.
Boolean Determines whether the form allows only one response per respondent.
Boolean Determines whether the form displays a progress bar.
Boolean Determines whether the form displays a link to submit another response after a respondent completes the form.
Boolean Determines whether the form is currently accepting responses.
Boolean Determines whether the form is published.
Boolean Determines whether the form displays a link to view a summary of responses after a respondent completes the form.
Boolean Determines whether the form is a quiz.
Item Moves an item at a given index among all the items in the form to another given index.
Item Moves a given item to a given index among all the items in the form.
Form Unlinks the form from its current response destination.
Form Removes the given user from the list of editors for the Form .
Form Removes the given user from the list of editors for the Form .
Form Removes the given user from the list of responders for the Form .
Form Removes the given user from the list of responders for the Form .
Form Sets whether the form is currently accepting responses.
Form Sets whether the form displays a link to edit a response after submitting it.
Form Sets whether the form collects respondents' email addresses.
Form Sets the form's confirmation message.
Form Sets the message to display if the form is not accepting responses.
Form Sets the form's description.
Form Sets the destination where form responses are saved.
Form Sets whether the form is a quiz.
Form Sets whether the form allows only one response per respondent.
Form Sets whether the form has a progress bar.
Form Sets whether the form is published.
Form Sets whether the form displays a link to view a summary of responses after a respondent submits the form.
Form Sets whether the form displays a link to submit another response after a respondent completes the form.
Form Sets whether the order of the questions on each page of the form is randomized.
Form Sets the form's title.
String Converts a long URL for a form to a short URL.
Form Submits grades for the given FormResponses.
Boolean Determines whether the form supports publishing.

Form App

Properties

Property Type Description
Alignment
Alignment An enumeration of types of image alignment.
Destination Type
Destination Type An enumeration of types of destinations that can store form responses.
Feedback Type
Feedback Type An enumeration of types of form Feedbacks .
Item Type
Item Type An enumeration of types of form Items .
Page Navigation Type
Page Navigation Type An enumeration of possible behaviors for navigating pages.
Rating Icon Type
Rating Icon Type An enumeration of rating icon types Rating Icons

Methods

Method Return type Brief description
Form Creates and returns a new Form .
Form Creates and returns a new Form in the requested publish state.
Checkbox Grid Validation Builder Returns an instance of a CheckboxGridValidationBuilder which can be used to set validation on a Checkbox Grid Item .
Checkbox Validation Builder Returns an instance of a CheckboxValidationBuilder which can be used to set validation on a Checkbox Item .
Quiz Feedback Builder Returns an instance of a QuizFeedbackBuilder which can be used to set feedback on a gradeable Item .
Grid Validation Builder Returns an instance of a GridValidationBuilder which can be used to set validation on a Grid Item .
Paragraph Text Validation Builder Returns an instance of a ParagraphTextValidationBuilder which can be used to set validation on a Paragraph Text Item .
Text Validation Builder Returns an instance of a TextValidationBuilder which can be used to set validation on a Text Item .
Form Returns the form to which the script is container-bound .
Ui Returns an instance of the form editor's user-interface environment that allows the script to add features like menus, dialogs, and sidebars.
Form Returns the Form with the specified ID.
Form Returns the Form with the specified URL.

Form Response

Methods

Method Return type Brief description
String Generates a URL that can be used to edit a response that has already been submitted.
Item Response[] Gets all item responses contained in a form response, in the same order that the items appear in the form.
Item Response Gets the item response contained in a form response for a given item.
String Gets the ID of the form response.
Item Response[] Gets all item responses contained in a form response, in the same order that the items appear in the form.
String Gets the email address of the person who submitted a response, if the Form.setCollectEmail(collect) setting is enabled.
Item Response Gets the item response contained in this form response for a given item.
Date Gets the timestamp for a form response submission.
Form Response Submits the response.
String Generates a URL for the form in which the answers are pre-filled based on the answers in this form response.
Form Response Adds the given item response's grades to a form response.
Form Response Adds the given item response to a form response.

Grid Item

Methods

Method Return type Brief description
Grid Item Removes any data validation for this grid item.
Item Response Creates a new Item Response for this grid item.
Grid Item Creates a copy of this item and appends it to the end of the form.
String[] Gets the values for every column in the grid.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
String[] Gets the values for every row in the grid.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the respondent must answer the question.
Grid Item Sets the columns of the grid based on an array of values.
Grid Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Grid Item Sets whether the respondent must answer the question.
Grid Item Sets the rows of the grid based on an array of values.
Grid Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).
Grid Item Sets the data validation for this grid item.

Grid Validation

Grid Validation Builder

Methods

Method Return type Brief description
Grid Validation Builder Requires limit of one response per column for a grid item.

Image Item

Methods

Method Return type Brief description
Image Item Creates a copy of this item and appends it to the end of the form.
Alignment Gets the image's horizontal alignment.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Blob Gets the image that is currently assigned to the item.
Integer Gets the index of the item among all the items in the form.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Integer Gets the image's width in pixels.
Image Item Sets the image's horizontal alignment.
Image Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Image Item Sets the image itself.
Image Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).
Image Item Sets the image's width in pixels.

Item

Methods

Method Return type Brief description
Checkbox Grid Item Returns the item as a checkbox grid item.
Checkbox Item Returns the item as a checkbox item.
Date Item Returns the item as a date item.
Date Time Item Returns the item as a date-time item.
Duration Item Returns the item as a duration item.
Grid Item Returns the item as a grid item.
Image Item Returns the item as an image item.
List Item Returns the item as a list item.
Multiple Choice Item Returns the item as a multiple-choice item.
Page Break Item Returns the item as a page-break item.
Paragraph Text Item Returns the item as a paragraph-text item.
Rating Item Returns the item as a rating item.
Scale Item Returns the item as a scale item.
Section Header Item Returns the item as a section-header item.
Text Item Returns the item as a text item.
Time Item Returns the item as a time item.
Video Item Returns the item as a video item.
Item Creates a copy of this item and appends it to the end of the form.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Item Response

Methods

Method Return type Brief description
Object Gets the feedback that was given for the respondent's submitted answer.
Item Gets the question item that this response answers.
Object Gets the answer that the respondent submitted.
Object Gets the score for the respondent's submitted answer.
Item Response Sets the feedback that should be displayed for the respondent's submitted answer.
Item Response Sets the score for the respondent's submitted answer.

Item Type

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.
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.
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.
RATING
Enum A question item that allows the respondent to give a rating.
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.
VIDEO
Enum A layout item that displays a YouTube video.
FILE_UPLOAD
Enum A question item that lets the respondent upload a file.
UNSUPPORTED
Enum An item that is currently not supported through APIs.

List Item

Methods

Method Return type Brief description
Choice Creates a new choice.
Choice Creates a new choice.
Choice Creates a new choice with a page-navigation option that jumps to a given page-break item.
Choice Creates a new choice with a page-navigation option.
Item Response Creates a new Item Response for this list item.
List Item Creates a copy of this item and appends it to the end of the form.
Choice[] Gets all choices for an item.
Quiz Feedback Returns the feedback that is shown to respondents when they respond correctly to a question.
Quiz Feedback Returns the feedback that is shown to respondents when they respond incorrectly to a question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the respondent must answer the question.
List Item Sets the choices for an item from an array of strings.
List Item Sets an array of choices for an item.
List Item Sets the feedback to be shown to respondents when they respond correctly to a question.
List Item Sets the feedback to be shown to respondents when they respond incorrectly to a question.
List Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
List Item Sets the number of points a gradeable item is worth.
List Item Sets whether the respondent must answer the question.
List Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Multiple Choice Item

Methods

Method Return type Brief description
Choice Creates a new choice.
Choice Creates a new choice.
Choice Creates a new choice with a page-navigation option that jumps to a given page-break item.
Choice Creates a new choice with a page-navigation option.
Item Response Creates a new Item Response for this multiple-choice item.
Multiple Choice Item Creates a copy of this item and appends it to the end of the form.
Choice[] Gets all choices for an item.
Quiz Feedback Returns the feedback that is shown to respondents when they respond correctly to a question.
Quiz Feedback Returns the feedback that is shown to respondents when they respond incorrectly to a question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the item has an "other" option.
Boolean Determines whether the respondent must answer the question.
Multiple Choice Item Sets the choices for an item from an array of strings.
Multiple Choice Item Sets an array of choices for an item.
Multiple Choice Item Sets the feedback to be shown to respondents when they respond correctly to a question.
Multiple Choice Item Sets the feedback to be shown to respondents when they respond incorrectly to a question.
Multiple Choice Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Multiple Choice Item Sets the number of points a gradeable item is worth.
Multiple Choice Item Sets whether the respondent must answer the question.
Multiple Choice Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).
Multiple Choice Item Sets whether the item has an "other" option.

Page Break Item

Methods

Method Return type Brief description
Page Break Item Creates a copy of this item and appends it to the end of the form.
Page Break Item Gets the Page Break Item 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).
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Page Navigation Type 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).
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Page Break Item 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).
Page Break Item 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).
Page Break Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Page Break Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

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.

Paragraph Text Item

Methods

Method Return type Brief description
Paragraph Text Item Removes any data validation for this paragraph text item.
Item Response Creates a new Item Response for this paragraph text item.
Paragraph Text Item Creates a copy of this item and appends it to the end of the form.
Quiz Feedback Returns the feedback that is shown to respondents when they respond to a gradeable question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the respondent must answer the question.
Paragraph Text Item Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading).
Paragraph Text Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Paragraph Text Item Sets the number of points a gradeable item is worth.
Paragraph Text Item Sets whether the respondent must answer the question.
Paragraph Text Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).
Paragraph Text Item Sets the data validation for this paragraph text item.

Paragraph Text Validation

Paragraph Text Validation Builder

Methods

Method Return type Brief description
Paragraph Text Validation Builder Requires response to contain pattern.
Paragraph Text Validation Builder Requires response to not contain pattern.
Paragraph Text Validation Builder Requires response to not match pattern.
Paragraph Text Validation Builder Requires response length to be greater than or equal to value.
Paragraph Text Validation Builder Requires response length to be less than value.
Paragraph Text Validation Builder Requires response to match pattern.

Quiz Feedback

Methods

Method Return type Brief description
String[] Gets a list of the URLs associated with the Feedback.
String Gets the Feedback's display text.

Quiz Feedback Builder

Methods

Method Return type Brief description
Quiz Feedback Builder Adds a link to the feedback's supplemental material.
Quiz Feedback Builder Adds a link to the feedback's supplemental material.
Quiz Feedback Builds a Feedback of the corresponding type for this builder.
Quiz Feedback Builder Returns a copy of this builder.
Quiz Feedback Builder Sets the feedback text.

Rating Icon Type

Properties

Property Type Description
STAR
Enum A star icon.
HEART
Enum A heart icon.
THUMB_UP
Enum A thumb up icon.

Rating Item

Methods

Method Return type Brief description
Item Response Creates a new Item Response for this rating item.
Rating Item Creates a copy of this item and appends it to the end of the form.
Quiz Feedback Returns the feedback that is shown to respondents when they respond to a gradeable question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
Rating Icon Type Gets the icon chosen for the rating.
Integer Gets the rating's scale level.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the respondent must answer the question.
Rating Item Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading).
Rating Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Rating Item Sets the number of points a gradeable item is worth.
Rating Item Sets the rating's icon.
Rating Item Sets the rating's maximum scale level.
Rating Item Sets whether the respondent must answer the question.
Rating Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Scale Item

Methods

Method Return type Brief description
Item Response Creates a new Item Response for this scale item.
Scale Item Creates a copy of this item and appends it to the end of the form.
Quiz Feedback Returns the feedback that is shown to respondents when they respond to a gradeable question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
String Gets the label for the scale's lower bound, if any.
Integer Gets the scale's lower bound.
Integer Returns the point value of a gradeable item.
String Gets the label for the scale's upper bound, if any.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Integer Gets the scale's upper bound.
Boolean Determines whether the respondent must answer the question.
Scale Item Sets the scale's lower and upper bounds.
Scale Item Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading).
Scale Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Scale Item Sets labels for the scale's lower and upper bounds.
Scale Item Sets the number of points a gradeable item is worth.
Scale Item Sets whether the respondent must answer the question.
Scale Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Section Header Item

Methods

Method Return type Brief description
Section Header Item Creates a copy of this item and appends it to the end of the form.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Section Header Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Section Header Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Text Item

Methods

Method Return type Brief description
Text Item Removes any data validation for this text item.
Item Response Creates a new Item Response for this text item.
Text Item Creates a copy of this item and appends it to the end of the form.
Quiz Feedback Returns the feedback that is shown to respondents when they respond to a gradeable question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the respondent must answer the question.
Text Item Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading).
Text Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Text Item Sets the number of points a gradeable item is worth.
Text Item Sets whether the respondent must answer the question.
Text Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).
Text Item Sets the data validation for this text item.

Text Validation

Text Validation Builder

Methods

Method Return type Brief description
Text Validation Builder Requires text item to be a number.
Text Validation Builder Requires text item to be a number between start and end, inclusive.
Text Validation Builder Requires text item to be a number equal to value specified.
Text Validation Builder Requires text item to be a number greater than the value specified.
Text Validation Builder Requires text item to be a number greater than or equal to the value specified.
Text Validation Builder Requires text item to be a number less than the value specified.
Text Validation Builder Requires text item to be a number less than or equal to the value specified.
Text Validation Builder Requires text item to be a number not between start and end, inclusive.
Text Validation Builder Requires text item to be a number not equal to the value specified.
Text Validation Builder Requires response to contain pattern.
Text Validation Builder Requires response to not contain pattern.
Text Validation Builder Requires response to not match pattern.
Text Validation Builder Requires text item to be an email address.
Text Validation Builder Requires text item to be a URL.
Text Validation Builder Requires response length to be greater than or equal to value.
Text Validation Builder Requires response length to be less than value.
Text Validation Builder Requires response to match pattern.
Text Validation Builder Requires text item to be a whole number.

Time Item

Methods

Method Return type Brief description
Item Response Creates a new Item Response for this time item.
Time Item Creates a copy of this item and appends it to the end of the form.
Quiz Feedback Returns the feedback that is shown to respondents when they respond to a gradeable question.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
Integer Returns the point value of a gradeable item.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Boolean Determines whether the respondent must answer the question.
Time Item Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading).
Time Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Time Item Sets the number of points a gradeable item is worth.
Time Item Sets whether the respondent must answer the question.
Time Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).

Video Item

Methods

Method Return type Brief description
Video Item Creates a copy of this item and appends it to the end of the form.
Alignment Gets the video's horizontal alignment.
String Gets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Integer Gets the item's unique identifier.
Integer Gets the index of the item among all the items in the form.
String Gets the item's title (sometimes called header text, in the case of a Section Header Item ).
Item Type Gets the item's type, represented as an Item Type .
Integer Gets the video's width in pixels.
Video Item Sets the video's horizontal alignment.
Video Item Sets the item's help text (sometimes called description text for layout items like Image Items , Page Break Items , and Section Header Items ).
Video Item Sets the item's title (sometimes called header text, in the case of a Section Header Item ).
Video Item Sets the video itself from a given YouTube URL or YouTube video ID.
Video Item Sets the video's width in pixels.
Create a Mobile Website
View Site in Mobile | Classic
Share by: