// Relationship NPS survey (with a follow-up for each score band) // 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("Relationship NPS survey (with a follow-up for each score band)"); form.setDescription("One question about [Company], and one about why. It takes less than a minute."); form.setConfirmationMessage("Thank you. We read every answer."); form.addScaleItem().setBounds(0, 10).setLabels("Not at all likely", "Extremely likely").setTitle("How likely are you to recommend [Company] to a friend or colleague?").setRequired(true); form.addParagraphTextItem().setTitle("We are sorry to hear that. What is the main thing we got wrong?").setHelpText("If the score was 0 to 6 (detractor)").setRequired(false); form.addParagraphTextItem().setTitle("What is the one thing that would have made your score higher?").setHelpText("If the score was 7 or 8 (passive)").setRequired(false); form.addParagraphTextItem().setTitle("Thank you. What is the main reason you would recommend us?").setHelpText("If the score was 9 or 10 (promoter)").setRequired(false); Logger.log("Edit your form: " + form.getEditUrl()); Logger.log("Share this link: " + form.getPublishedUrl()); }