Form Creation Demo

Source Code

function createFormDemo() {
  // name of the Form
  var form = FormApp.create('Google Apps Script for Educators Session')
  // creates a new item of the Form
  // creates paragraph items
  var item = form.addParagraphTextItem();
  item.setTitle('Name');
  form.addParagraphTextItem()
  .setTitle('Email:');
  
  // Multiple Choice Item
  form.addMultipleChoiceItem()
  .setTitle('What state are you in?')
  .setChoiceValues(['Georgia','Indiana','Michigan','New Jersey','Ohio','Pennsylvania']);
  form.addMultipleChoiceItem()
  .setTitle('How many years have you been teaching?')
  .setChoiceValues(['Student Teaching 😇','First Year! 😅','2 😉','3 😌','4 🤠','5 😷','6 🤔','7 🤖']);
  form.addMultipleChoiceItem()
  .setTitle('Computer Science Experience')
  .setChoiceValues(['None','Some','Expert'])
  form.addParagraphTextItem()
  .setTitle('What would you like to learn in this session?')
  
  // Logger Output
  Logger.log('Form URL: ' + form.getPublishedUrl());
  Logger.log('Editor URL: ' + form.getEditUrl());
  
}

Last updated

Was this helpful?