如果 H 列中任何单元格 =1 且主题包含 A、B 和 h 的数据,我需要收到电子邮件。来自相同的原料。
如果 H 列中任何单元格 =1 且主题包含 A、B 和 h 的数据,我需要收到电子邮件。来自相同的原料。
function myfunk00() {
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName("SheetName");
const sr = 2;//data start row
const vs = sh.getRange(sr,1,sh.getLastRow() + sr - 1,sh.getLastColumn()).getValues();
const msg = vs.reduce((acc,r,i) => {
if(r[7] == 1) {
acc.push(`ColumnA is ${r[0]} Column B is ${r[1]} and Column H is ${r[7]}`)
}
return acc;
},[])
GmailApp.sendEmail('your email','subject',msg.join('\n'))
}