I have a sheet, and in cell B1 I have a formula that states "TRUE" if certain conditions have been met on the sheet.
I have a time based trigger set up on my script to send me an email every 6 hours if B1 states TRUE.
Here is the script I am using:
function sendEmails2() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Function2")
var range = sheet.getRange("B1")
if (range = "TRUE"){
var emailAddress = "[email protected]"
var message = "Please check your MCR Tracker as it has new entries that neeed reviewing: URL"
var subject = "Your MCR Tracker has new entries"
MailApp.sendEmail(emailAddress,"[email protected]", subject, message)
}
}
When I manually run this script to test, it is sending an email, whether the condition has been met or not, rather than only if the condition has been met.
I'm very new to apps script, some help on where I have gone wrong would be appreciated!