Creating form with a script : Page Break and go to page issue

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 12:25:31

You only need to change the order of your operations; you do not need to keep the operations on item together. Here's an example, using your code:

function createForm() {
  var title = 'Multipage Form Test';
  var description = 'Stackoverflow question 17083500';

  var form = FormApp.create(title)
      .setDescription(description)
      .setConfirmationMessage('Thanks for responding!');

  var page1 = form.addPageBreakItem()
      .setTitle('First page');
  var item = form.addMultipleChoiceItem();
  var page2 = form.addPageBreakItem()
      .setTitle('Second page');
  var page3 = form.addPageBreakItem()
      .setTitle('Third page');

  item.setTitle('Question')
      .setChoices([
         item.createChoice('Yes',page2),
         item.createChoice('No',page3)
       ]);

  Logger.log(form.getEditUrl());
  Logger.log(form.getPublishedUrl());
}

Copy the "edit URL" from the Logs, and check - you'll find that the form has the behavior you are looking for:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!