title: Google sheet Script Error
body: <p>I have a form which submits various <code>scores (numbers)</code> and <code>N/A</code> (where the score is not applicable) , to a sheet. After each submission, I would like to change all the <code>N/A</code> entries in the most recent submission to <code>null</code> (or empty cell). That is, I would like to iterate over the most recent row (the last row) only, and do the changes.</p>
  
  <p>I have a trigger to run the script below when the form is submitted, but it does not work. How do I fix this issue?</p>
  
  <pre><code>function mySetValues() {  
  
   var targetSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Form Responses");
  
   var lr = targetSheet.getLastRow();
   var lc = targetSheet.getLastColumn();
  
   var range = targetSheet.getRange(lr,2, lr, lc)
  
    for(var i = 0; i &lt; range.length; i++){
  
      if(range[0][i] == "N/A" ){
       range[0][i].setValue(null);
      }
  }
  }
  </code></pre>