Home > database >  Google Sheets App Scripts If Else doesn't work
Google Sheets App Scripts If Else doesn't work

Time:01-20

I have created the following app script in my google sheets but its returning always true. why is that?

  if (Dsheet.getRange('A3').isBlank) {
Logger.log('true');
var dest = Dsheet.getRange('A1')
source.copyTo (dest, {formatOnly: true});
source.copyTo (dest, {contentsOnly: true});
} else {
  Logger.log('false');
  var lastRow = Dsheet.getLastRow() 5;
  var dest = Dsheet.getRange('A'   lastRow )
  source.copyTo (dest, {formatOnly: true});
  source.copyTo (dest, {contentsOnly: true});
}

CodePudding user response:

You have to call the function using ()

 if (Dsheet.getRange('A3').isBlank()) 
  •  Tags:  
  • Related