title: Implementation of Google script for Moving row from one sheet to another sheet Implementation
body: <p>I am trying to write a script that moves the rows that are marked as "recorded" from one google spreadsheet to another one. My script is mostly based on this script <a href="https://stackoverflow.com/questions/13337547/copy-one-row-from-one-sheet-to-another">[link]</a>. However,upon executing the script ,it doesn't move all of the recorded rows from the source spreadsheet to target spreadsheet. I checked the value of dest array(dest.length and dest[0].length). but i can't find anything wrong beside not all the targets rows being captured and not all selected rows being removed. I am not familiar with javascript. If anyone can point me to the right direction, that would be great. Also, I don't know if it matters, but the source spreadsheet still uses the older version whereas the target spreadsheet uses newer version.  </p>
  
  <pre><code>  var s = SpreadsheetApp.openByUrl('Link1'); \\Source spreadsheet
    var ss = s.getSheetByName('Sheet28'); 
    var t = SpreadsheetApp.openByUrl('Link2'); \\target spreadsheet
    var ts = t.getSheetByName('Sheet11');
    var data = ss.getRange(1,1, ss.getLastRow(),ss.getLastColumn()).getValues(); 
    var dest = [];
    Logger.log(data.length)
    for (var i = 1; i &lt; data.length; i++ ){
      if ( data[i][22] == 'recorded' &amp;&amp; data[i][22] !="") {
           dest.push(data[i]); 
         \\appending the array
           ss.deleteRow(i);
          \\delete the row
          }}
   Logger.log(dest.length);
   if (dest.length &gt; 0  &amp;&amp; dest[0].length &gt;0}{
     ts.getRange(ts.getLastRow()+1,1,dest.length,dest[0].length).setValues(dest);         
   }`
  </code></pre>