// NPS survey after an interaction // 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("NPS survey after an interaction"); form.setDescription("You recently [talked to our support team]. One question about it, and one about why."); form.setConfirmationMessage("Thank you. If something is still not right, reply to this message and we will pick it up."); form.addScaleItem().setBounds(0, 10).setLabels("Not at all likely", "Extremely likely").setTitle("Based on your recent [conversation with our support team], how likely are you to recommend [Company] 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()); }