Could you guys give me some help? I'm a total noob, so I would really appreciate your help :)
I'm trying to create a script for a spreadsheet that sends a message to an e-mail address on column L
every time, on the same row, column G
is Y
.
For example:
If G9
is edited to Y
, then an e-mail is sent to address specified on L9
.
Currently, I'm trying the script below but it is not working:
function onEditTrigger(e){
var range = e.range;
var intCol = range.getColumn();
if (intCol == 7){
var intRow = range.getRow();
var sheet = SpreadsheetApp.getActiveSheet();
var dataRange = sheet.getRange(intRow, 12, 11, 8);
var dataValues = dataRange.getValues();
MailApp.sendEmail(dataValues[0][0], "Notification", "Value in column C: "
+ dataValues[0][2]);
}
}
Error:
"TypeError: Cannot read property "range" from undefined. (line 2, file "send e-mail")"