I have a spreadsheet where I am keeping track of the expiration dates of certain licenses. I have a column set up next to the expiration dates to display "MUST RENEW" when today's date is within 30 days of the expiration date. I have been trying to create a script that will notify me by email when the status of a license changes to "MUST RENEW". So far, I have a script that emails me whenever any of the values in the column have changed. However, I cannot figure out how to only get emails when a single cell in the column changes to "MUST RENEW", not when the status changes at all.. Here is the script I have currently. If ANYONE could please tell me how to only be notified when a cell from my column changes to "MUST RENEW" I would greatly appreciate it!!!!
function checkValues(e)
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var valueToCheck = sheet.getRange(1,11).getValue();
let msg = "Someone's Alarm Agent license is expiring within 30 days."
if(valueToCheck = "MUST RENEW")
{
MailApp.sendEmail("
ch...@sfxav.com", "Alarm Agent License Expring Soon", msg);
}
}