title: Query last row with data in Google Sheet and set empty cells to "text"
body: <p>I'd like to query the last row with data of a Google sheet using Google Apps Script and set the empty cells to "Not Answered".</p>
  
  <p>I got it working with one cell and could of course apply this to the other 10 as needed, but I'd like to loop through them since that would be more efficient.</p>
  
  <p>Here is my single cell code that works.</p>
  
  <pre><code>function SetValues() {
    var ss = SpreadsheetApp.getActiveSheet();
    var lastRow = ss.getLastRow();
    var certVal = ss.getRange(lastRow,5,1).getValues();
  
    if (certVal == ''){
  ss.getRange(lastRow,5,1).setValue("Not Answered");
  }
  
   Logger.log(certVal)
  
  }
  </code></pre>