// Two-question NPS survey for inside a product // How to use: open https://script.google.com, start a new project, paste this file over the sample code and press Run. // Google asks you to allow the script to create a form. The form is saved in your Google Drive and its links appear in the execution log. function createSurvey() { var form = FormApp.create("Two-question NPS survey for inside a product"); form.setConfirmationMessage("Thanks, that helps."); form.addScaleItem().setBounds(0, 10).setLabels("Not at all likely", "Extremely likely").setTitle("How likely are you to recommend [Product] to a friend or colleague?").setRequired(true); form.addParagraphTextItem().setTitle("What is the main reason for your score?").setRequired(false); Logger.log("Edit your form: " + form.getEditUrl()); Logger.log("Share this link: " + form.getPublishedUrl()); }