title: Google sheets move row depending on value AND edit values
body: <p>I've been reading answers on Stack for ages and finally decided to join! So here is my first question:</p>
  
  <p>I found a google apps script here for google sheets that moves a row to another sheet depending on a cell value. This is great. I have tested it and it is working for me with a couple of alterations - first to use a checkbox, and second to copy all columns excluding the 1st column with the checkbox.</p>
  
  <p>However, for it to be really useful to me, what I'd like is to be able to edit a couple of values before adding the row to the new sheet.</p>
  
  <p>So it would be like this:</p>
  
  <ol>
  <li>if Checkbox = true, then copy row, all columns excluding checkbox</li>
  <li>Set value of 'location' to 'London' (column 8 for example)</li>
  <li>Set value of 'date' to today (column 12 for example)</li>
  <li>Add edited row to new sheet at the bottom</li>
  </ol>
  
  <p>Can anyone help me to achieve this? I'm guessing it must be quite simple but I am new to apps script so don't know how I'd do it.</p>
  
  <p>Here is the basic script for moving the row that I found from a 2011 post here:</p>
  
  <pre><code>function onEdit(event) {
    // assumes source data in sheet named Needed
    // target sheet of move to named Acquired
    // test column with checkbox is col 1 or A
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var s = event.source.getActiveSheet();
    var r = event.source.getActiveRange();
  
    if(s.getName() == "Needed" &amp;&amp; r.getColumn() == 1 &amp;&amp; r.getValue() == true) {
      var row = r.getRow();
      var numColumns = s.getLastColumn();
      var targetSheet = ss.getSheetByName("Acquired");
      var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
      s.getRange(row, 2, 1, numColumns).copyTo(target);
    }
  }
  </code></pre>
  
  <p>Hope someone can help. Thanks in advance!</p>