Software Installation Problem/Software Course Want to learn Call 8801005610

Get Google Forms Data in an Email Message

Whether you need a simple “Contact Me” form for your website or are trying to build a complex online poll, Google Forms are a perfect tool. You can customize Google forms with themes, the forms are mobile-friendly and the form data is automatically saved in a Google spreadsheet that can be easily exported to other formats like PDF or CSV.
Unlike other polling software, Google Forms can accept unlimited responses and they are absolutely free. You can also schedule Google Forms to stop accepting responses after a given date. There’s one limitation though.
Google Forms can send email notifications as soon as people submit your online form but, as shown in the screenshot, the actual form data isn’t included in the email message. You’ll have to open the associated Google Spreadsheet that is collecting the form responses to see the submitted data which is not always a very convenient option.
If you however wish to receive the submitted Google Forms data in an email message, Google Scripts can help. The simple script will trigger as soon as a user submits the form, it reads the form values entered by the user and sends them in an email message to your email address video.

Receive Google Forms data in Email

The Google Script for sending form notification emails is available in free and premium editions. The latter includes more features and you can opt for one-on-one support too.
FeaturesFreePremium
Works with Gmail & Google AppsYesYes
Personalize Form Emails with Logo & HTML formattingNoYes
Send confirmation emails to the form submitterNoYes
Customize the email subject and message body of notification emailsNoYes
Attach form data as PDF fileNoYes
Send Form notifications to multiple email addressesNoYes
Send form notification emails from another Gmail aliasNoYes
Set the reply-to address for notification emails as the form submitter’s addressNoYes
Installation Manual (PDF) includedNoYes
Support optionsNoneEmail
Forever FreePremium

Send Google Forms Data by Email

Here’s how you can add email notifications to any Google Form in few easy steps:
  1. Create a new form in Google Drive or you can use any of your existing Google form. Inside the form editor, click “View Responses” to open the Google Spreadsheet that is collecting the responses of your Google Form.
  2. While you are inside the spreadsheet, go to Tools –> Script Editor, remove any existing code and copy-paste the following snippet. Press Ctrl+S (or Cmd+S on Mac) to save the code and give your project any name (say “Send Google Forms by Email”).
  3. Replace amit@labnol.org in line #40 with your own email address where the notifications will arrive. You can add multiple email addresses too separated by commas. You may also change the subject in line #43.
  4. Go to the Run menu and choose Initialize. The Google Script will now require you to authorize the script – just click the Accept button and you’re done
  1. /*
  2. Send Google Form Data by Email v4.2
  3. Written by Amit Agarwal amit@labnol.org
  4. Source: http://labnol.org/?p=20884
  5. */
  6.  
  7. /**
  8. * @OnlyCurrentDoc
  9. */
  10.  
  11. function Initialize() {
  12.  
  13. try {
  14.  
  15. var triggers = ScriptApp.getProjectTriggers();
  16.  
  17. for (var i in triggers)
  18. ScriptApp.deleteTrigger(triggers[i]);
  19.  
  20. ScriptApp.newTrigger("EmailGoogleFormData")
  21. .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())
  22. .onFormSubmit().create();
  23.  
  24. } catch (error) {
  25. throw new Error("Please add this code in the Google Spreadsheet");
  26. }
  27. }
  28.  
  29. function EmailGoogleFormData(e) {
  30.  
  31. if (!e) {
  32. throw new Error("Please go the Run menu and choose Initialize");
  33. }
  34.  
  35. try {
  36.  
  37. if (MailApp.getRemainingDailyQuota() > 0) {
  38.  
  39. // You may replace this with another email address
  40. var email = "amit@labnol.org";
  41.  
  42. // Enter your subject for Google Form email notifications
  43. var subject = "Google Form Submitted";
  44.  
  45. var key, entry,
  46. message = "",
  47. ss = SpreadsheetApp.getActiveSheet(),
  48. cols = ss.getRange(1, 1, 1, ss.getLastColumn()).getValues()[0];
  49.  
  50. // Iterate through the Form Fields
  51. for (var keys in cols) {
  52.  
  53. key = cols[keys];
  54. entry = e.namedValues[key] ? e.namedValues[key].toString() : "";
  55.  
  56. // Only include form fields that are not blank
  57. if ((entry !== "") && (entry.replace(/,/g, "") !== ""))
  58. message += key + ' :: ' + entry + "\n\n";
  59. }
  60.  
  61. MailApp.sendEmail(email, subject, message);
  62. }
  63. } catch (error) {
  64. Logger.log(error.toString());
  65. }
  66. }
  67.  
  68. /* For support, contact developer at www.ctrlq.org */
Please make note that you need to paste the Google Script inside the Script Editor of the Responses Google spreadsheet and not the Google Form.
If you need to disable notifications, open the script editor again and choose Resources -> Current Script Triggers and delete the Form trigger associated with the “On Form Submit” action.
One more thing. Google Forms do not allow file uploads but you can use Google Scripts to allow anyone to upload files via a form to your Google Drive.
SHARE

Manohar Mohanta

Hi, I am Designer of computer solutions. I am CEO/Founder of computer hardware and software solutions. I am Creative Art Director, Web Designer, VHDL Programer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment