I hope someone can help me with this.
I want to achieve the following condition: When column B contains "10:00 PM" set columns "M" and "N" as true (checkbox).
I tried this code:
function sutenn() {
const ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName('Status')
var rg = sh.getRange(2,1,sh.getLastRow() - 1,sh.getLastColumn());
const vs = rg.getDisplayValues();//this was they key this returns a string not a date
let o =vs.map((r, i) => {
if ((r[1] == "10:00 PM" && (r[6] == "")) || ((r[2] == "Sunday") || (r[3] == "Sunday" ))) {
r[12] = true;
} else {
r[12] = false
}
return [r[12]];
});
sh.getRange(2,13,o.length, o[0].length).setValues(o);//setting the checkboxes
}
But it didn't work. Does someone know what should I do to achieve this condition?
