1 year ago

#72185

test-img

titleorbust

Send an automated email only when a SPECIFIC cell value changes in Google Sheets via App Script

Disclaimer: I'm extremely novice. Don't attack me, please.

I'm trying to get an automated email sent when a specific cell value drops below a pre determined value for inventory purposes.

Currently, I have it working but it sends an email every time I edit or change the sheet. I have done research on "OnEdit" vs "OnChange" triggers and can't seem to grasp it yet.

Currently, I am here:

function SendEmail() {
  var ui = SpreadsheetApp.getUi();
  var file = SpreadsheetApp.getActive();
  var sheet = file.getSheetByName("Inventory");

  if(sheet.getRange(4,4).getValue()<50){   
    MailApp.sendEmail("email@.com" + "," + "email2@.com", "ReOrder Alert",
    "Hi, Email Body!");
  }
}

Any help is greatly appreciated...

google-apps-script

google-sheets

onchange

0 Answers

Your Answer

Accepted video resources