I am working with Gforms and I need to send an email to "A Friend" When the last form submitted has in the "J" Column a certain value, in this case: "Roberto". This is my script. But it seems not to be working, I get no email when that value is submitted in a form. I did setup the trigger to run the script when a form is submitted.
function myNotification() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var ranchE = e.range.getRow();
var Kjota = "J";
var rangex = Kjota + ranchE;
var value = ss.getSheetByName("Respuestas de formulario").getRange(rangex).getValue();
var email = "heregoes@myemail.com";
if( value == "Roberto" ) {
MailApp.sendEmail(email, "Test", "Yes is Roberto");
}
}