An enum representing the supported types of page navigation. Page navigation types can be
accessed from Form
.
The page navigation occurs after the respondent completes a page that contains the option, and only if the respondent chose that option. If the respondent chose multiple options with page-navigation instructions on the same page, only the last navigation option has any effect. Page navigation also has no effect on the last page of a form.
Choices that use page navigation cannot be combined in the same item with choices that do not use page navigation.
To call an enum, you call its parent class, name, and property. For example,
FormApp.PageNavigationType.CONTINUE
.
// Create a form and add a new multiple-choice item and a page-break item. const form = FormApp.create('Form Name'); const item = form.addMultipleChoiceItem(); const pageBreak = form.addPageBreakItem(); // Set some choices with go-to-page logic. const rightChoice = item.createChoice( 'Vanilla', FormApp.PageNavigationType.SUBMIT, ); const wrongChoice = item.createChoice( 'Chocolate', FormApp.PageNavigationType.RESTART, ); // For GO_TO_PAGE, just pass in the page break item. For CONTINUE (normally the // default), pass in CONTINUE explicitly because page navigation cannot be mixed // with non-navigation choices. const iffyChoice = item.createChoice('Peanut', pageBreak); const otherChoice = item.createChoice( 'Strawberry', FormApp.PageNavigationType.CONTINUE, ); item.setChoices([rightChoice, wrongChoice, iffyChoice, otherChoice]);
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. |