I am trying to set an email trigger whenever the cell Value of Column E > Cell Value G1.
G1 is dynamic, so I cannot just put in a fix value therefore. I created the variable q3 for the value of G1 and I created the variable vA for array values of column E.
This is the code but somehow my script does not fire as it does not understand the q3 value in the loop. I wonder if its a syntax issue. Any help is appreciated.
function readCell() {
var ss=SpreadsheetApp.getActive();
var sh=ss.getSheetByName('test');
var q3=SpreadsheetApp.getActiveSheet().getRange('G1')
var vA=rg.getValues();
if(Number(vA[i][5])>q3) {
MailApp.sendEmail('blabla.sd@gmail.com','Hello World!')
}
}