Skip to content

Latest commit

 

History

History
795 lines (670 loc) · 159 KB

File metadata and controls

795 lines (670 loc) · 159 KB

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

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. Items can be accessed or created from a Form.

Method Description Return Type Return Description Status Implementation
clearValidation() Removes any data validation for this grid item. CheckboxGridItem this item, for chaining not started
createResponse(String) Creates a new ItemResponse for this checkbox grid item. The argument responses must be a String[][] array of arrays containing as many values as the number of inputs in the checkbox grid. A null element for a non-required checkbox grid question indicates no response to that row. Throws an exception if any of the values does not match a valid choice. ItemResponse the item response completed link
duplicate() Creates a copy of this item and appends it to the end of the form. CheckboxGridItem a duplicate of this CheckboxGridItem, for chaining completed link
getColumns() Gets the values for every column in the grid. String[] an array of column values, which respondents see as labels when viewing the form completed link
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getRows() Gets the values for every row in the grid. String[] an array of row values, which respondents see as labels when viewing the form completed link
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setColumns(String) Sets the columns of the grid based on an array of values. Throws an exception if the given array is empty. CheckboxGridItem this item, for chaining completed link
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). CheckboxGridItem this CheckboxGridItem, for chaining completed link
setRequired(Boolean) Sets whether the respondent must answer the question. CheckboxGridItem the current item (for chaining) completed link
setRows(String) Sets the rows of the grid based on an array of values. Throws an exception if the given array is empty. CheckboxGridItem this item, for chaining completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). CheckboxGridItem this CheckboxGridItem, for chaining completed link
setValidation(CheckboxGridValidation) Sets the data validation for this checkbox grid item. Passing in null or a validation without any require functions called will remove any prior validation. CheckboxGridItem this CheckboxGridItem, for chaining not started

A DataValidation for a CheckboxGridItem.

Method Description Return Type Return Description Status Implementation

A DataValidationBuilder for a CheckboxGridValidation.

Method Description Return Type Return Description Status Implementation
requireLimitOneResponsePerColumn() Requires limit of one response per column for a grid item. CheckboxGridValidationBuilder this validation builder, for chaining not started

A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. Items are created or accessed from a Form using methods such as Form.addCheckboxItem(). When used in a quiz, these items are autograded.

Method Description Return Type Return Description Status Implementation
clearValidation() Removes any data validation for this checkbox item. CheckboxItem this CheckboxItem, for chaining not started
createChoice(String,Boolean) not started
createChoice(String) Creates a new choice. Choice the new choice not started
createResponse(String) Creates a new ItemResponse for this checkbox item. The argument responses is a String[] array containing values that need to be checked. Throws an exception if any value does not match a valid choice for this item, unless showOtherOption(enabled) is set to true. ItemResponse the item response completed link
duplicate() Creates a copy of this item and appends it to the end of the form. CheckboxItem a duplicate of this CheckboxItem, for chaining completed link
getChoices() Gets all choices for an item. Choice[] an array of choices not started
getFeedbackForCorrect() Returns the feedback that is shown to respondents when they respond correctly to a question. QuizFeedback|null the feedback, if any. not started
getFeedbackForIncorrect() Returns the feedback that is shown to respondents when they respond incorrectly to a question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
hasOtherOption() Determines whether the item has an "other" option. Boolean true if the item has an "other" option; false if not not started
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setChoices(Choice) Sets an array of choices for an item. Throws an exception if the given array is empty or contains a null element. CheckboxItem this CheckboxItem, for chaining not started
setChoiceValues(String) Sets the choices for an item from an array of strings. Throws an exception if the given array is empty. CheckboxItem this CheckboxItem, for chaining not started
setFeedbackForCorrect(QuizFeedback) Sets the feedback to be shown to respondents when they respond correctly to a question. CheckboxItem this CheckboxItem, for chaining not started
setFeedbackForIncorrect(QuizFeedback) Sets the feedback to be shown to respondents when they respond incorrectly to a question. CheckboxItem this CheckboxItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). CheckboxItem this CheckboxItem, for chaining completed link
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. CheckboxItem this CheckboxItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. CheckboxItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). CheckboxItem this CheckboxItem, for chaining completed link
setValidation(CheckboxValidation) Sets the data validation for this checkbox item. Passing in null or a validation without any require functions called will remove any prior validation. CheckboxItem this CheckboxItem, for chaining not started
showOtherOption(Boolean) Sets whether the item has an "other" option. The default for a new CheckboxItem or MultipleChoiceItem is false. CheckboxItem this CheckboxItem, for chaining not started

A DataValidation for a CheckboxItem.

Method Description Return Type Return Description Status Implementation

A DataValidationBuilder for a CheckboxValidation.

Method Description Return Type Return Description Status Implementation
requireSelectAtLeast(Integer) Require at least this many choices to be selected. CheckboxValidationBuilder this CheckboxValidationBuilder, for chaining not started
requireSelectAtMost(Integer) Require at most this many choices to be selected. CheckboxValidationBuilder this CheckboxValidationBuilder, for chaining not started
requireSelectExactly(Integer) Require exactly this many choices to be selected. CheckboxValidationBuilder this CheckboxValidationBuilder, for chaining not started

Class: Choice

A single choice associated with a type of Item that supports choices, like CheckboxItem, ListItem, or MultipleChoiceItem.

Method Description Return Type Return Description Status Implementation
getGotoPage() Gets the PageBreakItem set as a GO_TO_PAGE destination if the responder selects this choice and completes the current page. This method applies only to choices associated with MultipleChoiceItems; for other choices, it returns null. PageBreakItem the GO_TO_PAGE destination for this choice, or null if there is none not started
getPageNavigationType() Gets the PageNavigationType that occurs if the responder selects this choice and completes the current page. This method applies only to choices associated with MultipleChoiceItems; for other choices, it returns null. PageNavigationType the navigation action for this choice, or null if there is none completed link
getValue() Gets the choice's value, which respondents see as a label when viewing the form. String the choice's value completed link
isCorrectAnswer() Gets whether the choice is a correct answer for the question. This method only applies to questions that are part of a quiz; for non-quiz forms, it returns false. Boolean Whether the choice is a correct answer. not started

Class: DateItem

A question item that allows the respondent to indicate a date. Items can be accessed or created from a Form. When used in a quiz, these items are graded.

Method Description Return Type Return Description Status Implementation
createResponse(Date) Creates a new ItemResponse for this date item. The time fields of the Date object are ignored; by default, only the year, month, and day fields are used. If setIncludesYear(enabled) is set to false, the year is ignored as well. ItemResponse the item response completed link
duplicate() Creates a copy of this item and appends it to the end of the form. DateItem a duplicate of this DateItem, for chaining completed link
getGeneralFeedback() Returns the feedback that is shown to respondents when they respond to a gradeable question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
includesYear() Determines whether the date item includes a year option. Boolean true if the date includes a year setting; false if not not started
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setGeneralFeedback(QuizFeedback) 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). DateItem this DateItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). DateItem this DateItem, for chaining completed link
setIncludesYear(Boolean) Sets whether the date item includes a year setting. The default for new date items is true. DateItem this DateItem, for chaining not started
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. DateItem this DateItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. DateItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). DateItem this DateItem, for chaining completed link

A question item that allows the respondent to indicate a date and time. Items can be accessed or created from a Form. When used in a quiz, these items are graded.

Method Description Return Type Return Description Status Implementation
createResponse(Date) Creates a new ItemResponse for this date-time item. The seconds field of the Date object is ignored; by default, the year, month, day, hour, and minute fields are used. If setIncludesYear(enabled) is set to false, the year is ignored as well. ItemResponse the item response not started
duplicate() Creates a copy of this item and appends it to the end of the form. DateTimeItem a duplicate of this DateTimeItem, for chaining completed link
getGeneralFeedback() Returns the feedback that is shown to respondents when they respond to a gradeable question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
includesYear() Determines whether the date item includes a year option. Boolean true if the date includes a year setting; false if not not started
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setGeneralFeedback(QuizFeedback) 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). DateTimeItem this DateTimeItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). DateTimeItem this DateTimeItem, for chaining completed link
setIncludesYear(Boolean) Sets whether the date item includes a year setting. The default for new date items is true. DateTimeItem this DateTimeItem, for chaining not started
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. DateTimeItem this DateTimeItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. DateTimeItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). DateTimeItem this DateTimeItem, for chaining completed link

A question item that allows the respondent to indicate a length of time. Items can be accessed or created from a Form. When used in a quiz, these items are graded.

Method Description Return Type Return Description Status Implementation
createResponse(Integer,Integer,Integer) completed link
duplicate() Creates a copy of this item and appends it to the end of the form. DurationItem a duplicate of this DurationItem, for chaining completed link
getGeneralFeedback() Returns the feedback that is shown to respondents when they respond to a gradeable question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setGeneralFeedback(QuizFeedback) 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). DurationItem this DurationItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). DurationItem this DurationItem, for chaining completed link
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. DurationItem this DurationItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. DurationItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). DurationItem this DurationItem, for chaining completed link

Class: Form

A form that contains overall properties and items. Properties include title, settings, and where responses are stored. Items include question items like checkboxes or radio items, while layout items refer to things like page breaks. Forms can be accessed or created from FormApp.

Method Description Return Type Return Description Status Implementation
addCheckboxGridItem() 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. CheckboxGridItem The newly created item. completed link
addCheckboxItem() Appends a new question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. CheckboxItem The newly created item. completed link
addDateItem() Appends a new question item that allows the respondent to indicate a date. DateItem The newly created item. completed link
addDateTimeItem() Appends a new question item that allows the respondent to indicate a date and time. DateTimeItem The newly created item. completed link
addDurationItem() Appends a new question item that allows the respondent to indicate a length of time. DurationItem The newly created item. completed link
addEditor(String) Adds the given user to the list of editors for the Form. If the user was already on the list of viewers or responders, this method promotes the user out of the list. Form This Form, for chaining. not started
addEditor(User) Adds the given user to the list of editors for the Form. If the user was already on the list of viewers or responders, this method promotes the user out of the list. Form This Form, for chaining. not started
addEditors(String) Adds the given array of users to the list of editors for the Form. If any of the users were already on the list of viewers, this method promotes them out of the list of viewers. Form This Form, for chaining. not started
addGridItem() 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. GridItem The newly created item. completed link
addImageItem() Appends a new layout item that displays an image. ImageItem The newly created item. not started
addListItem() Appends a new question item that allows the respondent to select one choice from a dropdown list. ListItem The newly created item. completed link
addMultipleChoiceItem() Adds a new question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. MultipleChoiceItem The newly created item. completed link
addPageBreakItem() Adds a new layout item that marks the start of a page. PageBreakItem The newly created item. completed link
addParagraphTextItem() Adds a new question item that allows the respondent to enter a block of text. ParagraphTextItem The newly created item. completed link
addPublishedReader(String) Adds the given user to the list of responders for the Form. If the user was already on the list of editors or viewers, this method has no effect. Form This Form, for chaining. not started
addPublishedReader(User) Adds the given user to the list of responders for the Form. If the user was already on the list of editors or viewers, this method has no effect. Form This Form, for chaining. not started
addPublishedReaders(String) Adds the given array of users to the list of responders for the Form. If the user was already on the list of editors or viewers, this method has no effect. Form This Form, for chaining. not started
addRatingItem() Appends a new question item that allows the respondent to give a rating. RatingItem The newly created item. not started
addScaleItem() Appends a new question item that allows the respondent to choose one option from a numbered sequence of radio buttons. ScaleItem The newly created item. completed link
addSectionHeaderItem() Appends a new layout item that visually indicates the start of a section. SectionHeaderItem The newly created item. completed link
addTextItem() Appends a new question item that allows the respondent to enter a single line of text. TextItem The newly created item. completed link
addTimeItem() Appends a new question item that allows the respondent to indicate a time of day. TimeItem The newly created item. completed link
addVideoItem() Appends a new layout item that displays a video. VideoItem The newly created item. not started
canEditResponse() Determines whether the form displays a link to edit a response after submitting it. Boolean true if the form displays an "Edit your response" link; false if it doesn't. not started
collectsEmail() Determines whether the form collects respondents' email addresses. Boolean true if the form collects email addresses; false if it doesn't. not started
createResponse() Creates a new response to the form. To answer a question item, create an ItemResponse from the item, then attach it to this form response by calling FormResponse.withItemResponse(response). To save the assembled response, call FormResponse.submit(). FormResponse The newly created form response. completed link
deleteAllResponses() Deletes all submitted responses from the form's response store. This method does not delete copies of responses stored in an external response destination (like a spreadsheet), but does clear the form's summary view. Form This Form, for chaining. completed link
deleteItem(Integer) Deletes the item at a given index among all the items in the form. Throws a scripting exception if no item exists at the given index. completed link
deleteItem(Item) Deletes the given item. Throws a scripting exception if the item has already been deleted. completed link
deleteResponse(String) Deletes a single response from the form's response store. This method does not delete copies of responses stored in an external response destination (like a spreadsheet), but does remove the response from the form's summary view. The response ID can be retrieved with FormResponse.getId(). Form This Form, for chaining. not started
getConfirmationMessage() Gets the form's confirmation message. String The form's confirmation message. not started
getCustomClosedFormMessage() 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 The custom message to display if the form is not accepting responses, or an empty string if no custom message is set. not started
getDescription() Gets the form's description. String The form's description. completed link
getDestinationId() Gets the ID of the form's response destination. String The ID of the form's response destination. completed link
getDestinationType() Gets the type of the form's response destination. DestinationType The type of the form's response destination. completed link
getEditors() Gets the list of editors for this Form. User[] An array of users with edit permission. not started
getEditUrl() Gets the URL that can be used to access the form's edit mode. String The URL to edit the form. completed link
getId() Gets the ID of the form. String The ID of the form. completed link
getItemById(Integer) Gets the item with a given ID. Returns null if the ID does not correspond to an item in the form. Item|null The item with the given ID, or null if the item does not exist in the form. completed link
getItems() Gets an array of all items in the form. Item[] An array of all items in the form. completed link
getItems(ItemType) Gets an array of all items of a given type. Item[] An array of all items of that type. completed link
getPublishedReaders() Gets the list of responders for this Form. User[] An array of users with responder permission. not started
getPublishedUrl() Gets the URL that can be used to respond to the form. String The URL to respond to the form. completed link
getResponse(String) Gets a single form response based on its response ID. Response IDs can be retrieved from FormResponse.getId(). FormResponse The form response. not started
getResponses() Gets an array of all of the form's responses. FormResponse[] An array of all of the form's responses. completed link
getResponses(Date) Gets an array of all of the form's responses after a given date and time. FormResponse[] The list of form responses. completed link
getShuffleQuestions() Determines whether the order of the questions on each page of the form is randomized. Boolean true if the order of the questions on each page of the form is randomized; false if not. not started
getSummaryUrl() Gets the URL that can be used to view a summary of the form's responses. Unless setPublishingSummary(enabled) is set to true, only the users with edit permission to the form is able to access the URL. String The URL to view a summary of responses. not started
getTitle() Gets the form's title. String The form's title. completed link
hasLimitOneResponsePerUser() Determines whether the form allows only one response per respondent. If the value is true, the script cannot submit form responses at all. Boolean true if the form allows only one response per respondent; false if not. not started
hasProgressBar() Determines whether the form displays a progress bar. Boolean true if the form displays a progress bar; false if it doesn't. not started
hasRespondAgainLink() Determines whether the form displays a link to submit another response after a respondent completes the form. Boolean true if the form displays a "Submit another response" link; false if it doesn't. not started
isAcceptingResponses() Determines whether the form is currently accepting responses. This is overwritten when the form's publishing state is changed. Boolean true if the form is accepting responses; false if it isn't. completed link
isPublished() Determines whether the form is published. Boolean true if the form is published; false if it isn't. completed link
isPublishingSummary() Determines whether the form displays a link to view a summary of responses after a respondent completes the form. Boolean true if the form displays a "See previous responses" link; false if it doesn't. not started
isQuiz() Determines whether the form is a quiz. Boolean true if the form is accepting responses; false if it isn't. not started
moveItem(Integer,Integer) completed link
moveItem(Item,Integer) completed link
removeDestination() Unlinks the form from its current response destination. The unlinked former destination still retains a copy of all previous responses. All forms, including those that do not have a destination set explicitly, save a copy of responses in the form's response store. If the form does not currently have a response destination, this method has no effect. Form This Form, for chaining. completed link
removeEditor(String) Removes the given user from the list of editors for the Form. This method doesn't block users from accessing the Form if they belong to a class of users who have general access—for example, if the Form is shared with the user's entire domain, or if the Form is in a shared drive that the user can access. Form This Form, for chaining. not started
removeEditor(User) Removes the given user from the list of editors for the Form. This method doesn't block users from accessing the Form if they belong to a class of users who have general access—for example, if the Form is shared with the user's entire domain, or if the Form is in a shared drive that the user can access. Form This Form, for chaining. not started
removePublishedReader(String) Removes the given user from the list of responders for the Form. This method doesn't block users from accessing the Form if they belong to a class of users who have general access—for example, if the Form is shared with the user's entire domain, or if the Form is in a shared drive that the user can access. Form This Form, for chaining. not started
removePublishedReader(User) Removes the given user from the list of responders for the Form. This method doesn't block users from accessing the Form if they belong to a class of users who have general access—for example, if the Form is shared with the user's entire domain, or if the Form is in a shared drive that the user can access. Form This Form, for chaining. not started
setAcceptingResponses(Boolean) Sets whether the form is currently accepting responses. The default for new forms is true. The state is overwritten when the publish state of the form is changed. Form This Form, for chaining. completed link
setAllowResponseEdits(Boolean) Sets whether the form displays a link to edit a response after submitting it. The default for new forms is false. Form This Form, for chaining. not started
setCollectEmail(Boolean) Sets whether the form collects respondents' email addresses. The default for new forms is false. Form This Form, for chaining. not started
setConfirmationMessage(String) Sets the form's confirmation message. Form This Form, for chaining. not started
setCustomClosedFormMessage(String) Sets the message to display if the form is not accepting responses. If no message is set, the form uses a default message. Form This Form, for chaining. not started
setDescription(String) Sets the form's description. Form This Form, for chaining. completed link
setDestination(DestinationType,String) completed link
setIsQuiz(Boolean) Sets whether the form is a quiz. The default for new forms is false. Form This Form, for chaining. not started
setLimitOneResponsePerUser(Boolean) Sets whether the form allows only one response per respondent. The default for new forms is false. If the value is set to true, the script cannot submit form responses at all. Form This Form, for chaining. not started
setProgressBar(Boolean) Sets whether the form has a progress bar. The default for new forms is false. Form This Form, for chaining. not started
setPublished(Boolean) Sets whether the form is published. The default for new forms is true. Form This Form, for chaining. completed link
setPublishingSummary(Boolean) Sets whether the form displays a link to view a summary of responses after a respondent submits the form. The default for new forms is false. Form This Form, for chaining. not started
setShowLinkToRespondAgain(Boolean) Sets whether the form displays a link to submit another response after a respondent completes the form. The default for new forms is true. Form This Form, for chaining. not started
setShuffleQuestions(Boolean) Sets whether the order of the questions on each page of the form is randomized. Form This Form, for chaining. not started
setTitle(String) Sets the form's title. Form This Form, for chaining. completed link
shortenFormUrl(String) Converts a long URL for a form to a short URL. Throws an exception if the long URL does not belong to Google Forms. String A URL in the form http://goo.gl/forms/1234. completed link
submitGrades(FormResponse) Submits grades for the given FormResponses. Form This Form, for chaining. not started
supportsAdvancedResponderPermissions() Determines whether the form supports publishing. This method is used to determine whether the setPublished(enabled) and isPublished() methods, and responder permissions, are available. Boolean true if the form supports publishing; false if it doesn't. not started

Class: FormApp

Allows a script to open an existing Form or create a new one.

Method Description Return Type Return Description Status Implementation
create(String,Boolean) completed link
create(String) Creates and returns a new Form. Throws an exception if the given title is null or empty. Form The new form. completed link
createCheckboxGridValidation() Returns an instance of a CheckboxGridValidationBuilder which can be used to set validation on a CheckboxGridItem. CheckboxGridValidationBuilder not started
createCheckboxValidation() Returns an instance of a CheckboxValidationBuilder which can be used to set validation on a CheckboxItem. CheckboxValidationBuilder not started
createFeedback() Returns an instance of a QuizFeedbackBuilder which can be used to set feedback on a gradeable Item. QuizFeedbackBuilder not started
createGridValidation() Returns an instance of a GridValidationBuilder which can be used to set validation on a GridItem. GridValidationBuilder not started
createParagraphTextValidation() Returns an instance of a ParagraphTextValidationBuilder which can be used to set validation on a ParagraphTextItem. ParagraphTextValidationBuilder not started
createTextValidation() Returns an instance of a TextValidationBuilder which can be used to set validation on a TextItem. TextValidationBuilder not started
getActiveForm() Returns the form to which the script is container-bound. To interact with forms to which the script is not container-bound, use openById(id) or openByUrl(url) instead. Form the form to which the script is bound, or null if the script is not bound to a form completed link
getUi() Returns an instance of the form editor's user-interface environment that allows the script to add features like menus, dialogs, and sidebars. A script can only interact with the UI for the current instance of an open form editor (not the view that a respondent sees), and only if the script is bound to the form. For more information, see the guides to menus and dialogs and sidebars. Ui an instance of this form's user-interface environment completed link
openById(String) Returns the Form with the specified ID. Throws an exception if the ID is invalid or the user does not have permission to open the form. Form the form with the given ID completed link
openByUrl(String) Returns the Form with the specified URL. Throws an exception if the URL is invalid or the user does not have permission to open the form. Form the form with the given URL completed link

A response to the form as a whole. A FormResponse can be used in three ways: to access the answers submitted by a respondent (see getItemResponses()), to programmatically submit a response to the form (see withItemResponse(response) and submit()), and to generate a URL for the form which pre-fills fields using the provided answers. FormResponses can be created or accessed from a Form.

Method Description Return Type Return Description Status Implementation
getEditResponseUrl() Generates a URL that can be used to edit a response that has already been submitted. If the Form.setAllowResponseEdits(enabled) setting is disabled, the link leads to a page that explains that editing form responses is disabled. Anyone who visits the link can edit the response, although they need an account with access to the form if the Form.setRequireLogin(requireLogin) setting is enabled. If the Form.setCollectEmail(collect) setting is enabled, the form records the email address of the user who edited the response instead of the email address of the original respondent. String The URL to change a submitted response. not started
getGradableItemResponses() Gets all item responses contained in a form response, in the same order that the items appear in the form. This method works similarly to getItemResponses(), but to allow for grading a missing answer, it still returns an ItemResponse if the corresponding Item can be graded (that is, has a point value), even if there isn't an actual response. However, if the Item isn't gradable, this method excludes that item from its returned array. ItemResponse[] An array of responses to every question item within the form for which the respondent could receive a score. not started
getGradableResponseForItem(Item) Gets the item response contained in a form response for a given item. This method works similarly to getResponseForItem(item), but to allow for grading a missing answer, it still returns an ItemResponse if the corresponding Item can be graded (that is, has a point value), even if there isn't an actual response. However, if the Item isn't gradable, this method returns null. ItemResponse The response for a given item, or null if none exists and the item is ungraded. not started
getId() Gets the ID of the form response. This method returns null if the form response has not been submitted. String|null The ID of the form response, or null if the form response has not been submitted. completed link
getItemResponses() Gets all item responses contained in a form response, in the same order that the items appear in the form. If the form response does not contain a response for a given TextItem, DateItem, TimeItem, or ParagraphTextItem, the ItemResponse returned for that item will have an empty string as the response. If the form response omits a response for any other item type, this method excludes that item from its returned array. ItemResponse[] An array of responses to every question item within the form for which the respondent provided an answer. completed link
getRespondentEmail() Gets the email address of the person who submitted a response, if the Form.setCollectEmail(collect) setting is enabled. String The email address of the person who submitted this response, if available, or null if the script created this response but has not yet submitted it. completed link
getResponseForItem(Item) Gets the item response contained in this form response for a given item. ItemResponse The response for a given item, or null if none exists. not started
getTimestamp() Gets the timestamp for a form response submission. Date The timestamp at which this response was submitted, or null if the script created this response but has not yet submitted it. completed link
submit() Submits the response. Throws a scripting exception if the response has already been submitted. FormResponse A newly created response saved to the form's response store. completed link
toPrefilledUrl() Generates a URL for the form in which the answers are pre-filled based on the answers in this form response. String The URL for a form with pre-filled answers. not started
withItemGrade(ItemResponse) Adds the given item response's grades to a form response. This method applies only to form responses that have already been submitted, and only affects stored grades once they are submitted. This method also only updates the item response's grades; it does not affect the actual response (since the response has already been submitted). If this method is called multiple times for the same item, only the last grade is retained. If the ItemResponse contains no grades, this method removes grades for the item. FormResponse this FormResponse, for chaining not started
withItemResponse(ItemResponse) Adds the given item response to a form response. This method applies only to form responses that the script has created but not yet submitted; it cannot affect stored responses. If this method is called multiple times for the same item, only the last item response is retained. FormResponse This FormResponse, for chaining. completed link

Class: 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. Items can be accessed or created from a Form.

Method Description Return Type Return Description Status Implementation
clearValidation() Removes any data validation for this grid item. GridItem this item, for chaining not started
createResponse(String) Creates a new ItemResponse for this grid item. The argument responses must be a String[] array containing as many values as the number of rows in the grid. A null element for a non-required grid question indicates no response to that row. Throws an exception if any of the values does not match a valid choice. ItemResponse the item response completed link
duplicate() Creates a copy of this item and appends it to the end of the form. GridItem a duplicate of this GridItem, for chaining completed link
getColumns() Gets the values for every column in the grid. String[] an array of column values, which respondents see as labels when viewing the form completed link
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getRows() Gets the values for every row in the grid. String[] an array of row values, which respondents see as labels when viewing the form completed link
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setColumns(String) Sets the columns of the grid based on an array of values. Throws an exception if the given array is empty. GridItem this item, for chaining completed link
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). GridItem this GridItem, for chaining completed link
setRequired(Boolean) Sets whether the respondent must answer the question. GridItem the current item (for chaining) completed link
setRows(String) Sets the rows of the grid based on an array of values. Throws an exception if the given array is empty. GridItem this item, for chaining completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). GridItem this GridItem, for chaining completed link
setValidation(GridValidation) Sets the data validation for this grid item. Passing in null or a GridValidation instance on which no require functions have been called removes any prior validation. GridItem this GridItem, for chaining not started

A DataValidation for a GridItem.

Method Description Return Type Return Description Status Implementation

A DataValidationBuilder for a GridValidation.

Method Description Return Type Return Description Status Implementation
requireLimitOneResponsePerColumn() Requires limit of one response per column for a grid item. GridValidationBuilder this validation builder, for chaining not started

Class: ImageItem

A layout item that displays an image. Items can be accessed or created from a Form.

Method Description Return Type Return Description Status Implementation
duplicate() Creates a copy of this item and appends it to the end of the form. ImageItem a duplicate of this ImageItem, for chaining completed link
getAlignment() Gets the image's horizontal alignment. Alignment the horizontal alignment not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getImage() Gets the image that is currently assigned to the item. Blob the image data not started
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
getWidth() Gets the image's width in pixels. Integer the width in pixels not started
setAlignment(Alignment) Sets the image's horizontal alignment. ImageItem this ImageItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). ImageItem this ImageItem, for chaining completed link
setImage(BlobSource) Sets the image itself. ImageItem this ImageItem, for chaining not started
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). ImageItem this ImageItem, for chaining completed link
setWidth(Integer) Sets the image's width in pixels. Only the image's width can be set. Height is set automatically to maintain the image's proportions. ImageItem this ImageItem, for chaining not started

A response to one question item within a form. Item responses can be accessed from FormResponse and created from any Item that asks the respondent to answer a question.

Method Description Return Type Return Description Status Implementation
getFeedback() Gets the feedback that was given for the respondent's submitted answer. Object a QuizFeedback for the question item not started
getItem() Gets the question item that this response answers. Item the question item that this response answers completed link
getResponse() Gets the answer that the respondent submitted. For most types of question items, this returns a String. Object a String or String[] or String[][] of answers to the question item completed link
getScore() Gets the score for the respondent's submitted answer. Object a Double representing the score for the question item not started
setFeedback(Object) Sets the feedback that should be displayed for the respondent's submitted answer. ItemResponse a ItemResponse for chaining not started
setScore(Object) Sets the score for the respondent's submitted answer. A null value will clear the existing score. ItemResponse a ItemResponse for chaining not started

Class: ListItem

A question item that allows the respondent to select one choice from a drop-down list. Items can be accessed or created from a Form.

Method Description Return Type Return Description Status Implementation
createChoice(String,Boolean) completed link
createChoice(String,PageBreakItem) completed link
createChoice(String,PageNavigationType) completed link
createChoice(String) Creates a new choice. Choice the new choice completed link
createResponse(String) Creates a new ItemResponse for this list item. Throws an exception if the response argument does not match a valid choice for this item. ItemResponse the item response completed link
duplicate() Creates a copy of this item and appends it to the end of the form. ListItem a duplicate of this ListItem, for chaining not started
getChoices() Gets all choices for an item. Choice[] an array of choices completed link
getFeedbackForCorrect() Returns the feedback that is shown to respondents when they respond correctly to a question. QuizFeedback|null the feedback, if any. not started
getFeedbackForIncorrect() Returns the feedback that is shown to respondents when they respond incorrectly to a question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text not started
getId() Gets the item's unique identifier. Integer the item's ID not started
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item not started
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text not started
getType() Gets the item's type, represented as an ItemType. ItemType the item's type not started
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question not started
setChoices(Choice) Sets an array of choices for an item. Throws an exception if the given array is empty or contains a null element. ListItem this ListItem, for chaining completed link
setChoiceValues(String) Sets the choices for an item from an array of strings. Throws an exception if the given array is empty. ListItem this ListItem, for chaining not started
setFeedbackForCorrect(QuizFeedback) Sets the feedback to be shown to respondents when they respond correctly to a question. ListItem this ListItem, for chaining not started
setFeedbackForIncorrect(QuizFeedback) Sets the feedback to be shown to respondents when they respond incorrectly to a question. ListItem this ListItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). ListItem this ListItem, for chaining not started
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. ListItem this ListItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. ListItem the current item (for chaining) not started
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). ListItem this ListItem, for chaining not started

A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. Items can be accessed or created from a Form. When used in a quiz, these items are autograded.

Method Description Return Type Return Description Status Implementation
createChoice(String,Boolean) not started
createChoice(String,PageBreakItem) not started
createChoice(String,PageNavigationType) not started
createChoice(String) Creates a new choice. Choice the new choice not started
createResponse(String) Creates a new ItemResponse for this multiple-choice item. Throws an exception if the response argument does not match a valid choice for this item, unless showOtherOption(enabled) is set to true. ItemResponse the item response completed link
duplicate() Creates a copy of this item and appends it to the end of the form. MultipleChoiceItem a duplicate of this MultipleChoiceItem, for chaining completed link
getChoices() Gets all choices for an item. Choice[] an array of choices not started
getFeedbackForCorrect() Returns the feedback that is shown to respondents when they respond correctly to a question. QuizFeedback|null the feedback, if any. not started
getFeedbackForIncorrect() Returns the feedback that is shown to respondents when they respond incorrectly to a question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
hasOtherOption() Determines whether the item has an "other" option. Boolean true if the item has an "other" option; false if not not started
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setChoices(Choice) Sets an array of choices for an item. Throws an exception if the given array is empty or contains a null element. MultipleChoiceItem this MultipleChoiceItem, for chaining not started
setChoiceValues(String) Sets the choices for an item from an array of strings. Throws an exception if the given array is empty. MultipleChoiceItem this MultipleChoiceItem, for chaining not started
setFeedbackForCorrect(QuizFeedback) Sets the feedback to be shown to respondents when they respond correctly to a question. MultipleChoiceItem this MultipleChoiceItem, for chaining not started
setFeedbackForIncorrect(QuizFeedback) Sets the feedback to be shown to respondents when they respond incorrectly to a question. MultipleChoiceItem this MultipleChoiceItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). MultipleChoiceItem this MultipleChoiceItem, for chaining completed link
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. MultipleChoiceItem this MultipleChoiceItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. MultipleChoiceItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). MultipleChoiceItem this MultipleChoiceItem, for chaining completed link
showOtherOption(Boolean) Sets whether the item has an "other" option. The default for a new CheckboxItem or MultipleChoiceItem is false. MultipleChoiceItem this MultipleChoiceItem, for chaining not started

A layout item that marks the start of a page. Items can be accessed or created from a Form.

Method Description Return Type Return Description Status Implementation
duplicate() Creates a copy of this item and appends it to the end of the form. PageBreakItem a duplicate of this PageBreakItem, for chaining completed link
getGoToPage() 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). PageBreakItem the page break to jump to after completing the page before this page break, or null if none is set completed link
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPageNavigationType() 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). PageNavigationType the navigation action to take after completing the page before this page break completed link
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
setGoToPage(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). If the previous page contained a MultipleChoiceItem or ListItem with a navigation option, that navigation overrules this navigation. PageBreakItem this PageBreakItem, for chaining completed link
setGoToPage(PageNavigationType) 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). If the page contained a MultipleChoiceItem or ListItem with a navigation option, that navigation overrules this navigation. PageBreakItem this PageBreakItem, for chaining completed link
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). PageBreakItem this PageBreakItem, for chaining completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). PageBreakItem this PageBreakItem, for chaining completed link

A question item that allows the respondent to enter a block of text. Items can be accessed or created from a Form. When used in a quiz, these items are graded.

Method Description Return Type Return Description Status Implementation
clearValidation() Removes any data validation for this paragraph text item. ParagraphTextItem this ParagraphTextItem, for chaining not started
createResponse(String) Creates a new ItemResponse for this paragraph text item. ItemResponse the item response not started
duplicate() Creates a copy of this item and appends it to the end of the form. ParagraphTextItem a duplicate of this ParagraphTextItem, for chaining completed link
getGeneralFeedback() Returns the feedback that is shown to respondents when they respond to a gradeable question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setGeneralFeedback(QuizFeedback) 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). ParagraphTextItem this ParagraphTextItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). ParagraphTextItem this ParagraphTextItem, for chaining completed link
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. ParagraphTextItem this ParagraphTextItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. ParagraphTextItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). ParagraphTextItem this ParagraphTextItem, for chaining completed link
setValidation(ParagraphTextValidation) Sets the data validation for this paragraph text item. Passing in null or a ParagraphTextValidation instance on which no require functions have been called removes any prior validation. ParagraphTextItem this ParagraphTextItem, for chaining not started

A DataValidation for a ParagraphTextItem.

Method Description Return Type Return Description Status Implementation

A DataValidationBuilder for a ParagraphTextValidation.

Method Description Return Type Return Description Status Implementation
requireTextContainsPattern(String) Requires response to contain pattern. ParagraphTextValidationBuilder this for chaining not started
requireTextDoesNotContainPattern(String) Requires response to not contain pattern. ParagraphTextValidationBuilder this for chaining not started
requireTextDoesNotMatchPattern(String) Requires response to not match pattern. ParagraphTextValidationBuilder this for chaining not started
requireTextLengthGreaterThanOrEqualTo(Integer) Requires response length to be greater than or equal to value. ParagraphTextValidationBuilder this for chaining not started
requireTextLengthLessThanOrEqualTo(Integer) Requires response length to be less than value. ParagraphTextValidationBuilder this for chaining not started
requireTextMatchesPattern(String) Requires response to match pattern. ParagraphTextValidationBuilder this for chaining not started

Represents feedback that can be associated with gradable form items, containing properties like display text and helpful links.

Method Description Return Type Return Description Status Implementation
getLinkUrls() Gets a list of the URLs associated with the Feedback. These are displayed to the user as a list of helpful links. String[] a list of the URLs associated with the Feedback not started
getText() Gets the Feedback's display text. This text is shown to the user after they've submitted a response. String the Feedback's text not started

The base FeedbackBuilder that contains setters for properties common to all feedback, such as display text. Used to build Feedback objects.

Method Description Return Type Return Description Status Implementation
addLink(String,String) not started
addLink(String) Adds a link to the feedback's supplemental material. QuizFeedbackBuilder this QuizFeedbackBuilder, for chaining not started
build() Builds a Feedback of the corresponding type for this builder. QuizFeedback QuizFeedback not started
copy() Returns a copy of this builder. QuizFeedbackBuilder QuizFeedbackBuilder not started
setText(String) Sets the feedback text. QuizFeedbackBuilder this QuizFeedbackBuilder, for chaining not started

Class: RatingItem

A question item that allows the respondent to give a rating. Items can be accessed or created from a Form. When used in a quiz, these items are graded.

Method Description Return Type Return Description Status Implementation
createResponse(Integer) Creates a new ItemResponse for this rating item. ItemResponse The item response. not started
duplicate() Creates a copy of this item and appends it to the end of the form. RatingItem a duplicate of this RatingItem, for chaining completed link
getGeneralFeedback() Returns the feedback that is shown to respondents when they respond to a gradeable question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getRatingIcon() Gets the icon chosen for the rating. RatingIconType The rating icon type. not started
getRatingScaleLevel() Gets the rating's scale level. Integer The rating scale level. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setGeneralFeedback(QuizFeedback) 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). RatingItem this RatingItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). RatingItem this RatingItem, for chaining completed link
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. RatingItem this RatingItem, for chaining not started
setRatingIcon(RatingIconType) Sets the rating's icon. RatingItem This RatingItem, for chaining. not started
setRatingScaleLevel(Integer) Sets the rating's maximum scale level. The rating's maximum scale level must be between 3 and 10, inclusive. A new rating defaults to a rating scale level of 3. RatingItem This RatingItem, for chaining. not started
setRequired(Boolean) Sets whether the respondent must answer the question. RatingItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). RatingItem this RatingItem, for chaining completed link

Class: ScaleItem

A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. Items can be accessed or created from a Form. When used in a quiz, these items are graded.

Method Description Return Type Return Description Status Implementation
createResponse(Integer) Creates a new ItemResponse for this scale item. Throws an exception if the response argument is outside the bounds set for the item. ItemResponse the item response completed link
duplicate() Creates a copy of this item and appends it to the end of the form. ScaleItem a duplicate of this ScaleItem, for chaining completed link
getGeneralFeedback() Returns the feedback that is shown to respondents when they respond to a gradeable question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getLeftLabel() Gets the label for the scale's lower bound, if any. String the label for the scale's lower bound completed link
getLowerBound() Gets the scale's lower bound. Integer the scale's lower bound completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getRightLabel() Gets the label for the scale's upper bound, if any. String the label for the scale's upper bound completed link
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
getUpperBound() Gets the scale's upper bound. Integer the scale's upper bound completed link
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setBounds(Integer,Integer) completed link
setGeneralFeedback(QuizFeedback) 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). ScaleItem this ScaleItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). ScaleItem this ScaleItem, for chaining completed link
setLabels(String,String) completed link
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. ScaleItem this ScaleItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. ScaleItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). ScaleItem this ScaleItem, for chaining completed link

A layout item that visually indicates the start of a section. Items can be accessed or created from a Form.

Method Description Return Type Return Description Status Implementation
duplicate() Creates a copy of this item and appends it to the end of the form. SectionHeaderItem a duplicate of this SectionHeaderItem, for chaining completed link
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). SectionHeaderItem this SectionHeaderItem, for chaining completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). SectionHeaderItem this SectionHeaderItem, for chaining completed link

Class: TextItem

A question item that allows the respondent to enter a single line of text. Items can be accessed or created from a Form. When used in a quiz, these items are graded.

Method Description Return Type Return Description Status Implementation
clearValidation() Removes any data validation for this text item. TextItem this TextItem, for chaining not started
createResponse(String) Creates a new ItemResponse for this text item. ItemResponse the item response completed link
duplicate() Creates a copy of this item and appends it to the end of the form. TextItem a duplicate of this TextItem, for chaining not started
getGeneralFeedback() Returns the feedback that is shown to respondents when they respond to a gradeable question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text not started
getId() Gets the item's unique identifier. Integer the item's ID not started
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item not started
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text not started
getType() Gets the item's type, represented as an ItemType. ItemType the item's type not started
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question not started
setGeneralFeedback(QuizFeedback) 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). TextItem this TextItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). TextItem this TextItem, for chaining not started
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. TextItem this TextItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. TextItem the current item (for chaining) not started
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). TextItem this TextItem, for chaining not started
setValidation(TextValidation) Sets the data validation for this text item. Passing in null or a validation without any require functions called will remove any prior validation. TextItem this TextItem, for chaining not started

A DataValidation for a TextItem.

Method Description Return Type Return Description Status Implementation

A DataValidationBuilder for a TextValidation.

Method Description Return Type Return Description Status Implementation
requireNumber() Requires text item to be a number. TextValidationBuilder this TextValidation, for chaining not started
requireNumberBetween(Number,Number) not started
requireNumberEqualTo(Number) Requires text item to be a number equal to value specified. TextValidationBuilder this TextValidation, for chaining not started
requireNumberGreaterThan(Number) Requires text item to be a number greater than the value specified. TextValidationBuilder this TextValidation, for chaining not started
requireNumberGreaterThanOrEqualTo(Number) Requires text item to be a number greater than or equal to the value specified. TextValidationBuilder this TextValidation, for chaining not started
requireNumberLessThan(Number) Requires text item to be a number less than the value specified. TextValidationBuilder this TextValidation, for chaining not started
requireNumberLessThanOrEqualTo(Number) Requires text item to be a number less than or equal to the value specified. TextValidationBuilder this TextValidation, for chaining not started
requireNumberNotBetween(Number,Number) not started
requireNumberNotEqualTo(Number) Requires text item to be a number not equal to the value specified. TextValidationBuilder this TextValidation, for chaining not started
requireTextContainsPattern(String) Requires response to contain pattern. TextValidationBuilder this for chaining not started
requireTextDoesNotContainPattern(String) Requires response to not contain pattern. TextValidationBuilder this for chaining not started
requireTextDoesNotMatchPattern(String) Requires response to not match pattern. TextValidationBuilder this for chaining not started
requireTextIsEmail() Requires text item to be an email address. TextValidationBuilder this TextValidation, for chaining not started
requireTextIsUrl() Requires text item to be a URL. TextValidationBuilder this TextValidation, for chaining not started
requireTextLengthGreaterThanOrEqualTo(Integer) Requires response length to be greater than or equal to value. TextValidationBuilder this for chaining not started
requireTextLengthLessThanOrEqualTo(Integer) Requires response length to be less than value. TextValidationBuilder this for chaining not started
requireTextMatchesPattern(String) Requires response to match pattern. TextValidationBuilder this for chaining not started
requireWholeNumber() Requires text item to be a whole number. TextValidationBuilder this TextValidation, for chaining not started

Class: TimeItem

A question item that allows the respondent to indicate a time of day. Items can be accessed or created from a Form. When used in a quiz, these items are graded.

Method Description Return Type Return Description Status Implementation
createResponse(Integer,Integer) completed link
duplicate() Creates a copy of this item and appends it to the end of the form. TimeItem a duplicate of this TimeItem, for chaining completed link
getGeneralFeedback() Returns the feedback that is shown to respondents when they respond to a gradeable question. QuizFeedback|null the feedback, if any. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getPoints() Returns the point value of a gradeable item. Integer the number of points a question is worth. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
isRequired() Determines whether the respondent must answer the question. Boolean whether the respondent must answer the question completed link
setGeneralFeedback(QuizFeedback) 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). TimeItem this TimeItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). TimeItem this TimeItem, for chaining completed link
setPoints(Integer) Sets the number of points a gradeable item is worth. The default for new items is 0. TimeItem this TimeItem, for chaining not started
setRequired(Boolean) Sets whether the respondent must answer the question. TimeItem the current item (for chaining) completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). TimeItem this TimeItem, for chaining completed link

Class: VideoItem

A layout item that displays a video. Items can be accessed or created from a Form.

Method Description Return Type Return Description Status Implementation
duplicate() Creates a copy of this item and appends it to the end of the form. VideoItem a duplicate of this VideoItem, for chaining completed link
getAlignment() Gets the video's horizontal alignment. Alignment the horizontal alignment not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). String the item's help text or description text completed link
getId() Gets the item's unique identifier. Integer the item's ID completed link
getIndex() Gets the index of the item among all the items in the form. Integer the index of the item completed link
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). String the item's title or header text completed link
getType() Gets the item's type, represented as an ItemType. ItemType the item's type completed link
getWidth() Gets the video's width in pixels. Integer the width in pixels not started
setAlignment(Alignment) Sets the video's horizontal alignment. VideoItem this VideoItem, for chaining not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). VideoItem this VideoItem, for chaining completed link
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). VideoItem this VideoItem, for chaining completed link
setVideoUrl(String) Sets the video itself from a given YouTube URL or YouTube video ID. VideoItem this VideoItem, for chaining not started
setWidth(Integer) Sets the video's width in pixels. Only the video's width can be set. Height is set automatically to maintain the video's proportions. VideoItem this VideoItem, for chaining not started

Enum: Alignment

An enum representing the supported types of image alignment. Alignment types can be accessed from FormApp.Alignment.

Property Description Status Implementation
CENTER Align the image to the center of the form. completed link
LEFT Align the image to the left side of the form. completed link
RIGHT Align the image to the right side of the form. completed link

An enum representing the supported types of form-response destinations. All forms, including those that do not have a destination set explicitly, save a copy of responses in the form's response store. Destination types can be accessed from FormApp.DestinationType.

Property Description Status Implementation
SPREADSHEET A Google Sheets spreadsheet as a destination for form responses. completed link

An enum representing the supported types of feedback. Feedback types can be accessed from FormApp.FeedbackType.

Property Description Status Implementation
CORRECT Feedback that is automatically displayed to respondents for a question answered correctly. Correct feedback can only be attached to a question type that supports autograding (e.g. radio, checkbox, select) completed link
GENERAL Feedback that is automatically displayed to respondents when they submit their response. General feedback can only be attached to question types that do not support auto-grading, but are gradeable (ie everything but grid) completed link
INCORRECT Feedback that is automatically displayed to respondents for a question answered incorrectly. Incorrect feedback can only be attached to a question type that supports autograding (e.g. radio, checkbox, select) completed link

Enum: ItemType

An enum representing the supported types of form items. Item types can be accessed from FormApp.ItemType.

Property Description Status Implementation
CHECKBOX A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. completed link
CHECKBOX_GRID 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. completed link
DATE A question item that allows the respondent to indicate a date. completed link
DATETIME A question item that allows the respondent to indicate a date and time. completed link
DURATION A question item that allows the respondent to indicate a length of time. completed link
FILE_UPLOAD A question item that lets the respondent upload a file. completed link
GRID 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. completed link
IMAGE A layout item that displays an image. completed link
LIST A question item that allows the respondent to select one choice from a drop-down list. completed link
MULTIPLE_CHOICE A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. completed link
PAGE_BREAK A layout item that marks the start of a page. completed link
PARAGRAPH_TEXT A question item that allows the respondent to enter a block of text. completed link
RATING A question item that allows the respondent to give a rating. completed link
SCALE A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. completed link
SECTION_HEADER A layout item that visually indicates the start of a section. completed link
TEXT A question item that allows the respondent to enter a single line of text. completed link
TIME A question item that allows the respondent to indicate a time of day. completed link
UNSUPPORTED An item that is currently not supported through APIs. completed link
VIDEO A layout item that displays a YouTube video. completed link

An enum representing the supported types of page navigation. Page navigation types can be accessed from FormApp.PageNavigationType.

Property Description Status Implementation
CONTINUE Continue to the next page of the form after completing the current page. completed link
GO_TO_PAGE Jump to a specified page of the form after completing the current page. completed link
RESTART Restart the form from the beginning, without clearing answers entered so far, after completing the current page. completed link
SUBMIT Submit the form response after completing the current page. completed link

An enum representing the supported types of rating icons.

Property Description Status Implementation
HEART A heart icon. completed link
STAR A star icon. completed link
THUMB_UP A thumb up icon. completed link

Interface: Item

A generic form item that contains properties common to all items, such as title and help text. Items can be accessed or created from a Form.

Property Description Status Implementation
asCheckboxGridItem() Returns the item as a checkbox grid item. Throws a scripting exception if the ItemType was not already CHECKBOX_GRID. not started
asCheckboxItem() Returns the item as a checkbox item. Throws a scripting exception if the ItemType was not already CHECKBOX. not started
asDateItem() Returns the item as a date item. Throws a scripting exception if the ItemType was not already DATE. not started
asDateTimeItem() Returns the item as a date-time item. Throws a scripting exception if the ItemType was not already DATETIME. not started
asDurationItem() Returns the item as a duration item. Throws a scripting exception if the ItemType was not already DURATION. not started
asGridItem() Returns the item as a grid item. Throws a scripting exception if the ItemType was not already GRID. not started
asImageItem() Returns the item as an image item. Throws a scripting exception if the ItemType was not already IMAGE. not started
asListItem() Returns the item as a list item. Throws a scripting exception if the ItemType was not already LIST. not started
asMultipleChoiceItem() Returns the item as a multiple-choice item. Throws a scripting exception if the ItemType was not already MULTIPLE_CHOICE. not started
asPageBreakItem() Returns the item as a page-break item. Throws a scripting exception if the ItemType was not already PAGE_BREAK. not started
asParagraphTextItem() Returns the item as a paragraph-text item. Throws a scripting exception if the ItemType was not already PARAGRAPH_TEXT. not started
asRatingItem() Returns the item as a rating item. Throws a ScriptingException if the ItemType was not already RATING. not started
asScaleItem() Returns the item as a scale item. Throws a scripting exception if the ItemType was not already SCALE. not started
asSectionHeaderItem() Returns the item as a section-header item. Throws a scripting exception if the ItemType was not already SECTION_HEADER. not started
asTextItem() Returns the item as a text item. Throws a scripting exception if the ItemType was not already TEXT. not started
asTimeItem() Returns the item as a time item. Throws a scripting exception if the ItemType was not already TIME. not started
asVideoItem() Returns the item as a video item. Throws a scripting exception if the ItemType was not already VIDEO. not started
duplicate() Creates a copy of this item and appends it to the end of the form. not started
getHelpText() Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). not started
getId() Gets the item's unique identifier. not started
getIndex() Gets the index of the item among all the items in the form. not started
getTitle() Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). not started
getType() Gets the item's type, represented as an ItemType. not started
setHelpText(String) Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). not started
setTitle(String) Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). not started