如果 H 列中任何单元格 =1 且主题包含 A、B 和 h 的数据,我需要收到电子邮件。来自相同的原料

问题描述 投票:0回答:1

如果 H 列中任何单元格 =1 且主题包含 A、B 和 h 的数据,我需要收到电子邮件。来自相同的原料。

如果 H 列中任何单元格 =1 且主题包含 A、B 和 h 的数据,我需要收到电子邮件。来自相同的原料。

google-apps-script spreadsheet sendmail getvalue trygetvalue
1个回答
0
投票
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'))
}
© www.soinside.com 2019 - 2024. All rights reserved.