Forms Service | Apps Script | Google for Developers (original) (raw)
Google Workspace services
Calendar
- Overview
- CalendarApp
- Classes
- Calendar
- CalendarEvent
- CalendarEventSeries
- EventGuest
- EventRecurrence
- RecurrenceRule
- Enums
- Color
- EventColor
- EventTransparency
- EventType
- GuestStatus
- Visibility
- Advanced services
- Calendar API
Docs
- Overview
- DocumentApp
- Classes
- Body
- Bookmark
- ContainerElement
- Date
- Document
- DocumentTab
- Equation
- EquationFunction
- EquationFunctionArgumentSeparator
- EquationSymbol
- FooterSection
- Footnote
- FootnoteSection
- HeaderSection
- HorizontalRule
- InlineDrawing
- InlineImage
- ListItem
- NamedRange
- PageBreak
- Paragraph
- Person
- Position
- PositionedImage
- Range
- RangeBuilder
- RangeElement
- RichLink
- Tab
- Table
- TableCell
- TableOfContents
- TableRow
- Text
- UnsupportedElement
- Interfaces
- Element
- Enums
- Attribute
- ElementType
- FontFamily
- GlyphType
- HorizontalAlignment
- ParagraphHeading
- PositionedLayout
- TabType
- TextAlignment
- VerticalAlignment
- Advanced services
- Docs API
Drive
- Overview
- DriveApp
- Classes
- File
- FileIterator
- Folder
- FolderIterator
- User
- Enums
- Access
- Permission
- Advanced services
- Drive API
- Drive Activity API
- Drive Labels API
Forms
- Overview
- FormApp
- Classes
- CheckboxGridItem
- CheckboxGridValidation
- CheckboxGridValidationBuilder
- CheckboxItem
- CheckboxValidation
- CheckboxValidationBuilder
- Choice
- DateItem
- DateTimeItem
- DurationItem
- Form
- FormResponse
- GridItem
- GridValidation
- GridValidationBuilder
- ImageItem
- ItemResponse
- ListItem
- MultipleChoiceItem
- PageBreakItem
- ParagraphTextItem
- ParagraphTextValidation
- ParagraphTextValidationBuilder
- QuizFeedback
- QuizFeedbackBuilder
- RatingItem
- ScaleItem
- SectionHeaderItem
- TextItem
- TextValidation
- TextValidationBuilder
- TimeItem
- VideoItem
- Interfaces
- Item
- Enums
- Alignment
- DestinationType
- FeedbackType
- ItemType
- PageNavigationType
- RatingIconType
Gmail
- Overview
- GmailApp
- Classes
- GmailAttachment
- GmailDraft
- GmailLabel
- GmailMessage
- GmailThread
- Advanced services
- Gmail API
Sheets
- Overview
- SpreadsheetApp
- Classes
- Banding
- BooleanCondition
- CellImage
- CellImageBuilder
- Color
- ColorBuilder
- ConditionalFormatRule
- ConditionalFormatRuleBuilder
- ContainerInfo
- DataSource for Connected Sheets
* BigQueryDataSourceSpec
* BigQueryDataSourceSpecBuilder
* DataExecutionStatus
* LookerDataSourceSpec
* LookerDataSourceSpecBuilder
* DataSource
* DataSourceChart
* DataSourceColumn
* DataSourceFormula
* DataSourceParameter
* DataSourcePivotTable
* DataSourceRefreshSchedule
* DataSourceRefreshScheduleFrequency
* DataSourceSheet
* DataSourceSheetFilter
* DataSourceSpec
* DataSourceSpecBuilder
* DataSourceTable
* DataSourceTableColumn
* DataSourceTableFilter - DataValidation
- DataValidationBuilder
- DateTimeGroupingRule
- DeveloperMetadata
- DeveloperMetadataFinder
- DeveloperMetadataLocation
- Drawing
- EmbeddedAreaChartBuilder
- EmbeddedBarChartBuilder
- EmbeddedChart
- EmbeddedChartBuilder
- EmbeddedColumnChartBuilder
- EmbeddedComboChartBuilder
- EmbeddedHistogramChartBuilder
- EmbeddedLineChartBuilder
- EmbeddedPieChartBuilder
- EmbeddedScatterChartBuilder
- EmbeddedTableChartBuilder
- Filter
- FilterCriteria
- FilterCriteriaBuilder
- GradientCondition
- Group
- NamedRange
- OverGridImage
- PageProtection
- PivotFilter
- PivotGroup
- PivotGroupLimit
- PivotTable
- PivotValue
- Protection
- Range
- RangeList
- RichTextValue
- RichTextValueBuilder
- Selection
- Sheet
- Slicer
- SortSpec
- Spreadsheet
- SpreadsheetTheme
- TextFinder
- TextRotation
- TextStyle
- TextStyleBuilder
- ThemeColor
- Enums
- AutoFillSeries
- BandingTheme
- BooleanCriteria
- BorderStyle
- CopyPasteType
- DataValidationCriteria
- DateTimeGroupingRuleType
- DeveloperMetadataLocationType
- DeveloperMetadataVisibility
- Dimension
- Direction
- FrequencyType
- GroupControlTogglePosition
- InterpolationType
- PivotTableSummarizeFunction
- PivotValueDisplayType
- ProtectionType
- RecalculationInterval
- RelativeDate
- SheetType
- SortOrder
- TextDirection
- TextToColumnsDelimiter
- ThemeColorType
- ValueType
- WrapStrategy
- Advanced services
- Sheets API
Slides
- Overview
- SlidesApp
- Classes
- AffineTransform
- AffineTransformBuilder
- AutoText
- Autofit
- Border
- Color
- ColorScheme
- ConnectionSite
- Fill
- Group
- Image
- Layout
- Line
- LineFill
- Link
- List
- ListStyle
- Master
- NotesMaster
- NotesPage
- Page
- PageBackground
- PageElement
- PageElementRange
- PageRange
- Paragraph
- ParagraphStyle
- PictureFill
- Point
- Presentation
- Selection
- Shape
- SheetsChart
- Slide
- SolidFill
- SpeakerSpotlight
- Table
- TableCell
- TableCellRange
- TableColumn
- TableRow
- TextRange
- TextStyle
- ThemeColor
- Video
- WordArt
- Enums
- AlignmentPosition
- ArrowStyle
- AutoTextType
- AutofitType
- CellMergeState
- ContentAlignment
- DashStyle
- FillType
- LineCategory
- LineFillType
- LineType
- LinkType
- ListPreset
- PageBackgroundType
- PageElementType
- PageType
- ParagraphAlignment
- PlaceholderType
- PredefinedLayout
- SelectionType
- ShapeType
- SheetsChartEmbedType
- SlideLinkingMode
- SlidePosition
- SpacingMode
- TextBaselineOffset
- TextDirection
- ThemeColorType
- VideoSourceType
- Advanced services
- Slides API
More...
- Groups
* Overview
* GroupsApp
* Classes
* Group
* Enums
* Role
* Advanced services
* Cloud Identity Groups API
* Migrate from Groups Service - People
* Advanced services
* People API
* Migrate from Contacts service
* Contacts
* Overview
* ContactsApp
* Classes
* AddressField
* CompanyField
* Contact
* ContactGroup
* CustomField
* DateField
* EmailField
* IMField
* PhoneField
* UrlField
* Enums
* ExtendedField
* Field
* Gender
* Priority
* Sensitivity
- Groups
Other Google services
Google Maps
YouTube
- Advanced services
- YouTube Data API
- YouTube Analytics API
- YouTube Content ID API
More...
- Google Ads & Merchant Center
- Google Data Studio
* Overview
* DataStudioApp
* Classes
* BigQueryConfig
* Checkbox
* CommunityConnector
* Config
* DebugError
* Field
* Fields
* GetAuthTypeResponse
* GetDataResponse
* GetSchemaResponse
* Info
* OptionBuilder
* SelectMultiple
* SelectSingle
* SetCredentialsResponse
* TextArea
* TextInput
* UserError
* Enums
* AggregationType
* AuthType
* BigQueryParameterType
* FieldType
Utility services
API & database connections
- JDBC
* Overview
* Jdbc
* Classes
* JdbcArray
* JdbcBlob
* JdbcCallableStatement
* JdbcClob
* JdbcConnection
* JdbcDatabaseMetaData
* JdbcDate
* JdbcParameterMetaData
* JdbcPreparedStatement
* JdbcRef
* JdbcResultSet
* JdbcResultSetMetaData
* JdbcRowId
* JdbcSQLXML
* JdbcSavepoint
* JdbcStatement
* JdbcStruct
* JdbcTime
* JdbcTimestamp
- JDBC
Data usability & optimization
- Optimization
* Overview
* LinearOptimizationService
* Classes
* LinearOptimizationConstraint
* LinearOptimizationEngine
* LinearOptimizationSolution
* Enums
* Status
* VariableType - XML
* Overview
* XmlService
* Classes
* Attribute
* Cdata
* Comment
* DocType
* Document
* Element
* EntityRef
* Format
* Namespace
* ProcessingInstruction
* Text
* Interfaces
* Content
* Enums
* ContentType
- Optimization
HTML & content
- Charts
* Overview
* Charts
* Classes
* AreaChartBuilder
* BarChartBuilder
* Chart
* ChartOptions
* ColumnChartBuilder
* DataTable
* DataTableBuilder
* DataViewDefinition
* DataViewDefinitionBuilder
* LineChartBuilder
* NumberRangeFilterBuilder
* PieChartBuilder
* ScatterChartBuilder
* StringFilterBuilder
* TableChartBuilder
* TextStyle
* TextStyleBuilder
* Interfaces
* DataTableSource
* Enums
* ChartHiddenDimensionStrategy
* ChartMergeStrategy
* ChartType
* ColumnType
* CurveStyle
* MatchType
* Orientation
* PickerValuesLayout
* PointStyle
* Position - HTML
* Overview
* google.script.history (client-side)
* google.script.host (client-side)
* google.script.run (client-side)
* google.script.url (client-side)
* HtmlService
* Classes
* HtmlOutput
* HtmlOutputMetaTag
* HtmlTemplate
* Enums
* SandboxMode
* XFrameOptionsMode
- Charts
Script execution & information
- Base
* Overview
* Browser
* Logger
* MimeType
* Session
* console
* Classes
* Blob
* Menu
* PromptResponse
* RgbColor
* Ui
* User
* Interfaces
* BlobSource
* Enums
* Button
* ButtonSet
* ColorType
* Month
* Weekday - Script
* Overview
* ScriptApp
* Classes
* AuthorizationInfo
* CalendarTriggerBuilder
* ClockTriggerBuilder
* DocumentTriggerBuilder
* FormTriggerBuilder
* Service
* SpreadsheetTriggerBuilder
* StateTokenBuilder
* Trigger
* TriggerBuilder
* Enums
* AuthMode
* AuthorizationStatus
* EventType
* InstallationSource
* TriggerSource
- Base
Script project resources
Manifest
Google Workspace add-ons
Services
- Card
* Overview
* CardService
* Classes
* Action
* ActionResponse
* ActionResponseBuilder
* ActionStatus
* Attachment
* AuthorizationAction
* AuthorizationException
* BorderStyle
* Button
* ButtonSet
* CalendarEventActionResponse
* CalendarEventActionResponseBuilder
* Card
* CardAction
* CardBuilder
* CardHeader
* CardSection
* CardWithId
* Carousel
* CarouselCard
* ChatActionResponse
* ChatClientDataSource
* ChatResponse
* ChatResponseBuilder
* ChatSpaceDataSource
* Chip
* ChipList
* CollapseControl
* Column
* Columns
* ComposeActionResponse
* ComposeActionResponseBuilder
* DatePicker
* DateTimePicker
* DecoratedText
* Dialog
* DialogAction
* Divider
* DriveItemsSelectedActionResponse
* DriveItemsSelectedActionResponseBuilder
* EditorFileScopeActionResponse
* EditorFileScopeActionResponseBuilder
* FixedFooter
* Grid
* GridItem
* HostAppDataSource
* IconImage
* Image
* ImageButton
* ImageComponent
* ImageCropStyle
* KeyValue
* LinkPreview
* MaterialIcon
* Navigation
* Notification
* OpenLink
* OverflowMenu
* OverflowMenuItem
* PlatformDataSource
* SelectionInput
* Suggestions
* SuggestionsResponse
* SuggestionsResponseBuilder
* Switch
* TextButton
* TextInput
* TextParagraph
* TimePicker
* UniversalActionResponse
* UniversalActionResponseBuilder
* UpdateDraftActionResponse
* UpdateDraftActionResponseBuilder
* UpdateDraftBccRecipientsAction
* UpdateDraftBodyAction
* UpdateDraftCcRecipientsAction
* UpdateDraftSubjectAction
* UpdateDraftToRecipientsAction
* UpdatedWidget
* Validation
* Widget
* Enums
* BorderType
* ChipListLayout
* CommonDataSource
* ComposedEmailType
* ContentType
* DisplayStyle
* GridItemLayout
* HorizontalAlignment
* HorizontalSizeStyle
* Icon
* ImageButtonStyle
* ImageCropType
* ImageStyle
* InputType
* Interaction
* LoadIndicator
* OnClose
* OpenAs
* ResponseType
* SelectionInputType
* Status
* SwitchControlType
* TextButtonStyle
* UpdateDraftBodyType
* VerticalAlignment
* WrapStyle - Conferencing Data
* Overview
* ConferenceDataService
* Classes
* ConferenceData
* ConferenceDataBuilder
* ConferenceError
* ConferenceParameter
* EntryPoint
* Enums
* ConferenceErrorType
* EntryPointFeature
* EntryPointType
- Card
Manifest
Apps Script API
v1
- Overview
- REST Resources
- Types
- ExecuteStreamResponse
- ExecutionError
- ExecutionResponse
- File
- LocalizedMessage
- NullValue
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](/apps-script/reference/forms/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](/apps-script/reference/forms/checkbox-grid-item)
[CheckboxGridValidation](/apps-script/reference/forms/checkbox-grid-validation)
[CheckboxGridValidationBuilder](/apps-script/reference/forms/checkbox-grid-validation-builder)
[CheckboxItem](/apps-script/reference/forms/checkbox-item)
[CheckboxValidation](/apps-script/reference/forms/checkbox-validation)
[CheckboxValidationBuilder](/apps-script/reference/forms/checkbox-validation-builder)
[Choice](/apps-script/reference/forms/choice)
[DateItem](/apps-script/reference/forms/date-item)
[DateTimeItem](/apps-script/reference/forms/date-time-item)
[DestinationType](/apps-script/reference/forms/destination-type)
Properties
Property | Type | Description |
---|---|---|
SPREADSHEET | Enum | A Google Sheets spreadsheet as a destination for form responses. |
[DurationItem](/apps-script/reference/forms/duration-item)
[FeedbackType](/apps-script/reference/forms/feedback-type)
Properties
Property | Type | Description |
---|---|---|
CORRECT | Enum | Feedback that is automatically displayed to respondents for a question answered correctly. |
INCORRECT | Enum | Feedback that is automatically displayed to respondents for a question answered incorrectly. |
GENERAL | Enum | Feedback that is automatically displayed to respondents when they submit their response. |
[Form](/apps-script/reference/forms/form)
[FormApp](/apps-script/reference/forms/form-app)
[FormResponse](/apps-script/reference/forms/form-response)
[GridItem](/apps-script/reference/forms/grid-item)
[GridValidation](/apps-script/reference/forms/grid-validation)
[GridValidationBuilder](/apps-script/reference/forms/grid-validation-builder)
[ImageItem](/apps-script/reference/forms/image-item)
[Item](/apps-script/reference/forms/item)
[ItemResponse](/apps-script/reference/forms/item-response)
[ItemType](/apps-script/reference/forms/item-type)
Properties
Property | Type | Description |
---|---|---|
CHECKBOX | Enum | A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. |
CHECKBOX_GRID | Enum | A question item, presented as a grid of columns and rows, that allows the respondent to select multiple choices per row from a sequence of checkboxes. |
DATE | Enum | A question item that allows the respondent to indicate a date. |
DATETIME | Enum | A question item that allows the respondent to indicate a date and time. |
DURATION | Enum | A question item that allows the respondent to indicate a length of time. |
GRID | Enum | A question item, presented as a grid of columns and rows, that allows the respondent to select one choice per row from a sequence of radio buttons. |
IMAGE | Enum | A layout item that displays an image. |
LIST | Enum | A question item that allows the respondent to select one choice from a drop-down list. |
MULTIPLE_CHOICE | Enum | A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. |
PAGE_BREAK | Enum | A layout item that marks the start of a page. |
PARAGRAPH_TEXT | Enum | A question item that allows the respondent to enter a block of text. |
RATING | Enum | A question item that allows the respondent to give a rating. |
SCALE | Enum | A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |
SECTION_HEADER | Enum | A layout item that visually indicates the start of a section. |
TEXT | Enum | A question item that allows the respondent to enter a single line of text. |
TIME | Enum | A question item that allows the respondent to indicate a time of day. |
VIDEO | Enum | A layout item that displays a YouTube video. |
FILE_UPLOAD | Enum | A question item that lets the respondent upload a file. |
UNSUPPORTED | Enum | An item that is currently not supported through APIs. |
[ListItem](/apps-script/reference/forms/list-item)
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](/apps-script/reference/forms/multiple-choice-item)
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](/apps-script/reference/forms/page-break-item)
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](/apps-script/reference/forms/page-navigation-type)
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](/apps-script/reference/forms/paragraph-text-item)
[ParagraphTextValidation](/apps-script/reference/forms/paragraph-text-validation)
[ParagraphTextValidationBuilder](/apps-script/reference/forms/paragraph-text-validation-builder)
[QuizFeedback](/apps-script/reference/forms/quiz-feedback)
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](/apps-script/reference/forms/quiz-feedback-builder)
[RatingIconType](/apps-script/reference/forms/rating-icon-type)
Properties
Property | Type | Description |
---|---|---|
STAR | Enum | A star icon. |
HEART | Enum | A heart icon. |
THUMB_UP | Enum | A thumb up icon. |
[RatingItem](/apps-script/reference/forms/rating-item)
[ScaleItem](/apps-script/reference/forms/scale-item)
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](/apps-script/reference/forms/text-item)
[TextValidation](/apps-script/reference/forms/text-validation)
[TextValidationBuilder](/apps-script/reference/forms/text-validation-builder)
[TimeItem](/apps-script/reference/forms/time-item)
[VideoItem](/apps-script/reference/forms/video-item)
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.