彰化一整天的論壇

 找回密碼
 立即註冊
查看: 1435|回復: 0

his service allows scripts to create, access, and modify Google Forms

[複製鏈接]
發表於 2019-7-31 13:03:36 | 顯示全部樓層 |閱讀模式
his service allows scripts to create, access, and modify Google Forms


  1. // Create a new form, then add a checkbox question, a multiple choice question,
  2. // a page break, then a date question and a grid of questions.
  3. var form = FormApp.create('New Form');
  4. var item = form.addCheckboxItem();
  5. item.setTitle('What condiments would you like on your hot dog?');
  6. item.setChoices([
  7.         item.createChoice('Ketchup'),
  8.         item.createChoice('Mustard'),
  9.         item.createChoice('Relish')
  10.     ]);
  11. form.addMultipleChoiceItem()
  12.     .setTitle('Do you prefer cats or dogs?')
  13.     .setChoiceValues(['Cats','Dogs'])
  14.     .showOtherOption(true);
  15. form.addPageBreakItem()
  16.     .setTitle('Getting to know you');
  17. form.addDateItem()
  18.     .setTitle('When were you born?');
  19. form.addGridItem()
  20.     .setTitle('Rate your interests')
  21.     .setRows(['Cars', 'Computers', 'Celebrities'])
  22.     .setColumns(['Boring', 'So-so', 'Interesting']);
  23. Logger.log('Published URL: ' + form.getPublishedUrl());
  24. Logger.log('Editor URL: ' + form.getEditUrl());
複製代碼
資料來源: https://developers.google.com/apps-script/reference/forms/
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

 ㄚ母滴雞湯
 員林香純滴雞精

Archiver|手機版|小黑屋|彰化一整天的論壇(Excel,Office)

GMT+8, 2022-5-19 13:09 , Processed in 0.027436 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回復 返回頂部 返回列表