title: Google Spreadheets Scripts: check if cell is empty
body: <p>I want to input a variable in a cell only if the cell is empty. The if statement, however, does not work. Any advice?</p>
  
  <pre><code>var ss=SpreadsheetApp.getActiveSpreadsheet();
  var r=ss.getRange("'odpovědi'!A2:J");
  
  var rws=r.getNumRows();
  
  ax=r.getCell(rws-1, 10).getValue();
  
  if (ax == "") {
    ax = "foo";
    r.getCell(rws-1, 9).setValue(ax);
  }
  </code></pre>