可以帮助解决以下问题吗???对应用程序脚本/ javascript 来说非常新,希望能提供任何帮助或指导来弄清楚..
类型错误:在对象时间戳中找不到函数偏移量,(然后继续在红色警告横幅中列出列标题。
function uiSendLogEmail() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var data = sheet.getDataRange().getValues();
data = data.offset(1,0,data.getNumRows())-1;
// For Loop
for ( var i = 0; i < data.length; i++ ) {
var row = data[i];
var approved = row[5];
var sentEmail = row[6];
var snapshot = row[3];
//if stmt in For Loop
if ( approved != "Yes" ) {
data[i][5] = "Yes";
data.getDataRange().setValues(data);
}// if stmt end curly
else if ( approved == "Yes" && sentEmail != "Yes" ) {
data[i][6] = "Yes";
data.getDataRange().setValues(data);
GmailApp.sendEmail("email@email.com", "subject", "body" + "whatever " + snapshot);
}//else if end curly
else {
return;
}//else stmt end curly
}// for loop end curly
}