Still on a learning curve here.(这里仍然处于学习曲线上。)
I am trying to get data from a google sheet and send the data Gmail app but getting Missing variable name error.(我正在尝试从Google工作表中获取数据并发送数据Gmail应用程序,但出现缺少变量名错误。) This is what I have tried for the last 2 hours and I will appreciate help in structuring the code to work.(这是我过去2个小时内一直在尝试的工作,我将感谢您为代码的正常工作提供帮助。)
function emailTheLastRow(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var range = sheet.getRange("AO2:AO"+sheet.getLastRow()).getValues();
var searchString = "1";
for (var i = 0; i<range.length; i++) {
if(range[i][0] == searchString) {
var lastRow = sheet.getRange(2+i,1,1,41).getValues();
var data = {
'email':lastRow[0][1],
'project':lastRow[0][2],
'client':lastRow[0][3],
'sdate':lastRow[0][4],
'edate':lastRow[0][5],
'loe':lastRow[0][7],
};
GmailApp.sendEmail("[email protected]", "Project", "A new project has been created with the following details: " + data());
}
}
}
ask by levi translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…