I am new to script and added this script which worked:
function sendEmailAlert() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var cellValue = ss.getActiveSheet().getActiveRange().getA1Notation();
var getRow = ss.getActiveSheet().getActiveRange().getRow();
var sheetname = ss.getActiveSheet().getName();
var user = Session.getActiveUser().getEmail();
var Toemail = '....email address....';
var subject = 'New Entry -' + ss.getName();
var body = 'Your file has a new entry in - ' + sheetname + ' Updated by - ' + user + ' check file- ' + ss.getUrl();
if(Number(ss.getActiveCell().getValue()!=-1.23456789) && getRow ==3) {
MailApp.sendEmail(Toemail,subject, body);
}
};
However, as I would like to find out which specific cell was changed and the new value, the updated script fails to save so I cannot run it. I guess the mistake is in var body, can anyone help?
function sendEmailAlert() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var cellValue = ss.getActiveSheet().getActiveRange().getA1Notation();
var getRow = ss.getActiveSheet().getActiveRange().getRow();
var sheetname = ss.getActiveSheet().getName();
var user = Session.getActiveUser().getEmail();
var Toemail = '...email address';
var subject = 'New Entry -' + ss.getName();
var body = 'Your file has a new entry in - ' + sheetname + ' Updated by - ' + user + ‘New Value in –‘ + cellValue + ‘= ‘ +ss.getActiveCell().getValue() +
' check file- ' + ss.getUrl();
if(Number(ss.getActiveCell().getValue()!=-1.23456789) && getRow ==3) {
MailApp.sendEmail(Toemail,subject, body);
}
};