A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/apps-script/reference/forms below:

Forms Service | Apps Script

Skip to main content Forms Service

Stay organized with collections Save and categorize content based on your preferences.

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. CheckboxGridItem 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. CheckboxGridValidation A DataValidation for a CheckboxGridItem. CheckboxGridValidationBuilder A DataValidationBuilder for a CheckboxGridValidation. CheckboxItem A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. CheckboxValidation A DataValidation for a CheckboxItem. CheckboxValidationBuilder A DataValidationBuilder for a CheckboxValidation. Choice A single choice associated with a type of Item that supports choices, like CheckboxItem, ListItem, or MultipleChoiceItem. DateItem A question item that allows the respondent to indicate a date. DateTimeItem A question item that allows the respondent to indicate a date and time. DestinationType An enum representing the supported types of form-response destinations. DurationItem A question item that allows the respondent to indicate a length of time. FeedbackType An enum representing the supported types of feedback. Form A form that contains overall properties and items. FormApp Allows a script to open an existing Form or create a new one. FormResponse A response to the form as a whole. GridItem A question item, presented as a grid of columns and rows, that allows the respondent to select one choice per row from a sequence of radio buttons. GridValidation A DataValidation for a GridItem. GridValidationBuilder A DataValidationBuilder for a GridValidation. ImageItem A layout item that displays an image. Item A generic form item that contains properties common to all items, such as title and help text. ItemResponse A response to one question item within a form. ItemType An enum representing the supported types of form items. ListItem A question item that allows the respondent to select one choice from a drop-down list. MultipleChoiceItem A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. PageBreakItem A layout item that marks the start of a page. PageNavigationType An enum representing the supported types of page navigation. ParagraphTextItem A question item that allows the respondent to enter a block of text. ParagraphTextValidation A DataValidation for a ParagraphTextItem. ParagraphTextValidationBuilder A DataValidationBuilder for a ParagraphTextValidation. QuizFeedback The bean implementation of a Feedback, which contains properties common to all feedback, such as display text or links. QuizFeedbackBuilder The base FeedbackBuilder that contains setters for properties common to all feedback, such as display text. RatingIconType An enum representing the supported types of rating icons. RatingItem A question item that allows the respondent to give a rating. ScaleItem A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. SectionHeaderItem A layout item that visually indicates the start of a section. TextItem A question item that allows the respondent to enter a single line of text. TextValidation A DataValidation for a TextItem. TextValidationBuilder A DataValidationBuilder for a TextValidation. TimeItem A question item that allows the respondent to indicate a time of day. VideoItem 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. CheckboxGridItem CheckboxGridValidation CheckboxGridValidationBuilder CheckboxItem CheckboxValidation CheckboxValidationBuilder Choice DateItem DateTimeItem DestinationType Properties Property Type Description SPREADSHEET Enum A Google Sheets spreadsheet as a destination for form responses. DurationItem FeedbackType 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 FormApp FormResponse GridItem GridValidation GridValidationBuilder ImageItem Item ItemResponse ItemType Properties Property Type Description CHECKBOX Enum A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. 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. ListItem Methods Method Return type Brief description createChoice(value) Choice Creates a new choice. createChoice(value, isCorrect) Choice Creates a new choice. createChoice(value, navigationItem) Choice Creates a new choice with a page-navigation option that jumps to a given page-break item. createChoice(value, navigationType) Choice Creates a new choice with a page-navigation option. createResponse(response) ItemResponse Creates a new ItemResponse for this list item. duplicate() ListItem Creates a copy of this item and appends it to the end of the form. getChoices() Choice[] Gets all choices for an item. getFeedbackForCorrect() QuizFeedback Returns the feedback that is shown to respondents when they respond correctly to a question. getFeedbackForIncorrect() QuizFeedback Returns the feedback that is shown to respondents when they respond incorrectly to a question. getHelpText() String Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). getId() Integer Gets the item's unique identifier. getIndex() Integer Gets the index of the item among all the items in the form. getPoints() Integer Returns the point value of a gradeable item. getTitle() String Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). getType() ItemType Gets the item's type, represented as an ItemType. isRequired() Boolean Determines whether the respondent must answer the question. setChoiceValues(values) ListItem Sets the choices for an item from an array of strings. setChoices(choices) ListItem Sets an array of choices for an item. setFeedbackForCorrect(feedback) ListItem Sets the feedback to be shown to respondents when they respond correctly to a question. setFeedbackForIncorrect(feedback) ListItem Sets the feedback to be shown to respondents when they respond incorrectly to a question. setHelpText(text) ListItem Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). setPoints(points) ListItem Sets the number of points a gradeable item is worth. setRequired(enabled) ListItem Sets whether the respondent must answer the question. setTitle(title) ListItem Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). MultipleChoiceItem Methods Method Return type Brief description createChoice(value) Choice Creates a new choice. createChoice(value, isCorrect) Choice Creates a new choice. createChoice(value, navigationItem) Choice Creates a new choice with a page-navigation option that jumps to a given page-break item. createChoice(value, navigationType) Choice Creates a new choice with a page-navigation option. createResponse(response) ItemResponse Creates a new ItemResponse for this multiple-choice item. duplicate() MultipleChoiceItem Creates a copy of this item and appends it to the end of the form. getChoices() Choice[] Gets all choices for an item. getFeedbackForCorrect() QuizFeedback Returns the feedback that is shown to respondents when they respond correctly to a question. getFeedbackForIncorrect() QuizFeedback Returns the feedback that is shown to respondents when they respond incorrectly to a question. getHelpText() String Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). getId() Integer Gets the item's unique identifier. getIndex() Integer Gets the index of the item among all the items in the form. getPoints() Integer Returns the point value of a gradeable item. getTitle() String Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). getType() ItemType Gets the item's type, represented as an ItemType. hasOtherOption() Boolean Determines whether the item has an "other" option. isRequired() Boolean Determines whether the respondent must answer the question. setChoiceValues(values) MultipleChoiceItem Sets the choices for an item from an array of strings. setChoices(choices) MultipleChoiceItem Sets an array of choices for an item. setFeedbackForCorrect(feedback) MultipleChoiceItem Sets the feedback to be shown to respondents when they respond correctly to a question. setFeedbackForIncorrect(feedback) MultipleChoiceItem Sets the feedback to be shown to respondents when they respond incorrectly to a question. setHelpText(text) MultipleChoiceItem Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). setPoints(points) MultipleChoiceItem Sets the number of points a gradeable item is worth. setRequired(enabled) MultipleChoiceItem Sets whether the respondent must answer the question. setTitle(title) MultipleChoiceItem Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). showOtherOption(enabled) MultipleChoiceItem Sets whether the item has an "other" option. PageBreakItem Methods Method Return type Brief description duplicate() PageBreakItem Creates a copy of this item and appends it to the end of the form. getGoToPage() PageBreakItem Gets the PageBreakItem that the form will jump to after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). getHelpText() String Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). getId() Integer Gets the item's unique identifier. getIndex() Integer Gets the index of the item among all the items in the form. getPageNavigationType() PageNavigationType Gets the type of page navigation that occurs after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). getTitle() String Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). getType() ItemType Gets the item's type, represented as an ItemType. setGoToPage(goToPageItem) PageBreakItem Sets the page to jump to after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). setGoToPage(navigationType) PageBreakItem Sets the type of page navigation that occurs after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). setHelpText(text) PageBreakItem Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). setTitle(title) PageBreakItem Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). PageNavigationType Properties Property Type Description CONTINUE Enum Continue to the next page of the form after completing the current page. GO_TO_PAGE Enum Jump to a specified page of the form after completing the current page. RESTART Enum Restart the form from the beginning, without clearing answers entered so far, after completing the current page. SUBMIT Enum Submit the form response after completing the current page. ParagraphTextItem ParagraphTextValidation ParagraphTextValidationBuilder QuizFeedback Methods Method Return type Brief description getLinkUrls() String[] Gets a list of the URLs associated with the Feedback. getText() String Gets the Feedback's display text. QuizFeedbackBuilder RatingIconType Properties Property Type Description STAR Enum A star icon. HEART Enum A heart icon. THUMB_UP Enum A thumb up icon. RatingItem ScaleItem Methods Method Return type Brief description createResponse(response) ItemResponse Creates a new ItemResponse for this scale item. duplicate() ScaleItem Creates a copy of this item and appends it to the end of the form. getGeneralFeedback() QuizFeedback Returns the feedback that is shown to respondents when they respond to a gradeable question. getHelpText() String Gets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). getId() Integer Gets the item's unique identifier. getIndex() Integer Gets the index of the item among all the items in the form. getLeftLabel() String Gets the label for the scale's lower bound, if any. getLowerBound() Integer Gets the scale's lower bound. getPoints() Integer Returns the point value of a gradeable item. getRightLabel() String Gets the label for the scale's upper bound, if any. getTitle() String Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem). getType() ItemType Gets the item's type, represented as an ItemType. getUpperBound() Integer Gets the scale's upper bound. isRequired() Boolean Determines whether the respondent must answer the question. setBounds(lower, upper) ScaleItem Sets the scale's lower and upper bounds. setGeneralFeedback(feedback) ScaleItem 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). setHelpText(text) ScaleItem Sets the item's help text (sometimes called description text for layout items like ImageItems, PageBreakItems, and SectionHeaderItems). setLabels(lower, upper) ScaleItem Sets labels for the scale's lower and upper bounds. setPoints(points) ScaleItem Sets the number of points a gradeable item is worth. setRequired(enabled) ScaleItem Sets whether the respondent must answer the question. setTitle(title) ScaleItem Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem). TextItem TextValidation TextValidationBuilder TimeItem VideoItem

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-04-08 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-08 UTC."],[[["Google Apps Script allows programmatic creation, access, and modification of Google Forms, including various question types and form settings."],["Developers can use Apps Script to automate tasks like collecting responses, managing form access, and customizing form appearance."],["The FormApp class provides methods for creating, opening, and manipulating forms, while Item classes represent individual form elements."],["Form responses can be accessed and managed using the FormResponse class, enabling tasks like retrieving response data and generating pre-filled URLs."],["Comprehensive documentation details various classes, methods, and properties for interacting with Google Forms through Apps Script."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4