这是我的代码。我只是在单元格不为空时才尝试执行代码。因为我们没有isBlank的内置函数,但我使用它来填充具有预定义值的空单元格。但确实如此
for (var i = 2, k = 2, j = 2, s = 2; i<lastrow && k>0; s++){
var range = sheet.getRange(i,1);
var company = range.getValue();
var range = sheet.getRange(i,2);
var description = range.getValue();
var range = sheet.getRange(i,3);
var priority = range.getValue();
var range = sheet.getRange(i,4);
var urgency = range.getValue();
var range = sheet.getRange(i,5);
var impact = range.getValue();
var range = sheet.getRange(i,6);
var requester = range.getValue();
var range = sheet.getRange(i,7);
var status = range.getValue();
var range = sheet.getRange(i,8);
var subject = range.getValue();
var pay="{\"helpdesk_ticket\":{ \"description\":\""+description+"\", \"subject\":\""+subject+"\",\"email\":\""+requester+"\",\"priority\":\""+priority+"\",\"status\":\""+status+"\",\"impact\":\""+impact+"\", \"urgency\":\""+urgency+"\" }}";
if(description.isBlank()){
var url="https://"+purl+"/helpdesk/tickets.json";
var options = {
"payload": pay,
"method": "POST",
"muteHttpExceptions": true,
错误信息:
isBlank()
是类Range
的方法。然而你试图在description
上调用它,Range
不是类Number
的对象,而是Boolean
,Date
,String
或here中描述的qazxswpoi