用于查找Cell是否为空的Google脚本 - isBlank函数不起作用

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

这是我的代码。我只是在单元格不为空时才尝试执行代码。因为我们没有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,

错误信息:

google-sheets-api google-sheets-query
1个回答
0
投票

isBlank()是类Range的方法。然而你试图在description上调用它,Range不是类Number的对象,而是BooleanDateStringhere中描述的qazxswpoi

© www.soinside.com 2019 - 2024. All rights reserved.