1

Zapier only provides functionality to monitoring rows. How can I monitor changes to only specific columns?

function sendEmailAlert() {

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var data = ss.getActiveSheet().getActiveCell().getA1Notation();
  var sheetname = ss.getActiveSheet().getName();
  var user = Session.getActiveUser().getEmail();
  var Toemail = 'my_email@gmail.com';
  var subject = 'New Entry -' + ss.getName();
  var body = 'Your file has a new entry in - ' + sheetname + ' Updated by - ' + user +
    ' check file now- ' + ss.getUrl();
  
  if(getColumn ==2 || getColumn ==3) {
    MailApp.sendEmail(Toemail,subject, body);
 }

};

Following the suggestion here. Just need some tips on what should be inside the if conditions and trigger conditions.

2
  • Have you tried the "On Change" installable trigger?
    – Alan Wells
    Oct 29 '20 at 15:19
  • thanks for the comment! I will look into it but I found an alternative solution as the following:
    – timing
    Oct 29 '20 at 20:08
0
function sendEmailAlert() {

  var ss = SpreadsheetApp.getActiveSpreadsheet();

  var sheetname = ss.getActiveSheet().getName();
  var user = Session.getActiveUser().getEmail();
  var cell = ss.getCurrentCell()
  var col = cell.getColumn();
  var row = cell.getRow();
  
  var Toemail = 'my_email@gmail.com';
  var subject = 'New Entry -' + ss.getName();
  var body = 'Your file has a new entry in - ' + sheetname + ' Updated by - ' + user +
    ' check file now- ' + ss.getUrl();

  
  if(col === 2 |col === 1) {
    MailApp.sendEmail(Toemail,subject, body);
 }

};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.