How to trigger a script in Google Spreadsheet with .NET?

Is it possible to autorespond form entries from a Google Form?

  • Im trying to use a google script in order to automatically autorespond an email, I found a code on the following website but I haven´t been able to get it to work http://productforums.google.com/forum/#!category-topic/docs/how-do-i/AJcLJSx6i1g I made a google docs form, and in http://script.google.com I pasted the code and made the changes mentioned in the instructions, however the post is from 2011 so perhaps its outdated, I hope someone can assist ----- heres the code and instructions, Select and copy all of the below, then Select "Tools" => "Script Editor", highlight everything in rows 1-3, then paste, save, and enter a name for the script.  Then, within the script, follow the 3-step instructions to make the personal modifications needed to have it work with your form and spreadsheet: function EmailFormConfirmation() {     // 3-Step Instructions:   // 1) Place the following formula into an empty cell in the first row,   //     in a Column to the right of Columns that populate from the form:   =indirect("C"&counta(A1:A))   //     Change C in above formula to the Column in your sheet that has email addresses from the form   // 2) In the following two program lines, "var sheetname" and "var columnnumber",   // Change the name of the sheet (currently set to Sheet1, the default name)   // Change the column number to the number representing the Column that you placed the indirect formula,   // from step 1, above   // i.e. B=2, C=3, D=4, J=10, O=15, T=20, Z=26, AA=27, AZ=52, etc...(currently set to 10, for Column J)     var sheetname = "Sheet1"   var columnnumber = 10     // 3) After saving this script, select "Triggers" => "Current script's triggers" => Click to add a script   //     Choose this script's name, select "From spreadsheet" and select "On form submit", and then save   //   //  That's it!   // Main script follows         var ss = SpreadsheetApp.getActiveSpreadsheet();   var sheet = ss.getSheetByName(sheetname);   var email = sheet.getRange(1,columnnumber).getValue();    // Determines row number of most recent form submission and sets it as "lastrow"   if (sheet.getRange(sheet.getMaxRows(),1).getValue() != "") {     var lastrow = sheet.getMaxRows()         }   else {       var count = 0       for (var i = 0; i < sheet.getMaxRows(); i++) {         if (sheet.getRange(sheet.getMaxRows()-i,1).getValue() != "") {           var lastrow = sheet.getMaxRows()-i           break;         }        }    }   // Email address regex (regular expression)   // Test for valid Email Pattern/Format - Allows any two-letter country code top level domain,   // and only specific generic top level domains   // (update via: http://en.wikipedia.org/wiki/List_of_top_level_domains)    var emailPattern = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|aero|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|name|museum|name|net|org|pro|tel|travel)\b/;   var validEmailAddress = emailPattern.test(email);     // The following sends an email if the email pattern is valid (i.e. if the email address is of an acceptable format)    // Edit the text you want in the body of the email and the subject you want (send a test message to yourself to test)                                                if (validEmailAddress == true) {       var message = "<HTML><BODY>"         + "<br /><br />"         + "<P>This is an automated form completion email.  Thanks for submitting!!!"         + "</HTML></BODY>";           MailApp.sendEmail(email, "Form Completion Email", "", {htmlBody: message});   // Returns a confirmation message whether email was sent, in the Column designated in step 1   // You can change these confirmation messages, or get rid of them altogether by making these   // lines comment lines by adding the "//" to the beginning of the next 3 lines           sheet.getRange(lastrow,columnnumber,1,1).setValue("Email Sent");       }  else{      sheet.getRange(lastrow,columnnumber,1,1).setValue("Email not Sent - Invalid Email Address submitted"); }   }

  • Answer:

Mark Simchock at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.