【发布时间】:2020-05-14 12:01:09
【问题描述】:
我一直在研究一些基于特定条件过滤工作表的 Google Apps 脚本代码。
发送一封电子邮件,过滤后的数据显示在 HTML 表格中。
我想让它只在该过滤器中有数据时才发送此电子邮件。
我尝试了以下方法:
var newdata = tableRangeValues.filter(function(item) {
return item[0] === filt && item[1] === endDate;
});
if(newdata !== "") {
GmailApp.sendEmail(
"someemail@somedomain.com",
"New EMEA Distribution Onboarding Request(s)",
"You have received the following new Request(s). Please see the details below.",
{htmlBody: htmlForEmail}
);
}
(只贴了相关的sn-p)
很遗憾,这不起作用。有谁知道实现它的方法吗?
【问题讨论】: