title: Google Sheets script conflict - two onEdits
body: <p>I have two scripts that I need to work with on Google Sheets. The first one auto sorts all rows if I put a date on column 23. The other script moves the entire row to another sheet called completed when I check a box on row 28. Separate they work perfectly but when I add them to the same script one of them stops working. How can I tweak this?</p>
  <p><img src="https://i.stack.imgur.com/q7yrq.png" alt="enter image description here" /></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>function autoSort(){
    
    const ss = SpreadsheetApp.getActiveSpreadsheet()
    const ws = ss.getSheetByName("Installation")
    const range = ws.getRange(2,1,ws.getLastRow()-1,28)
  
    range.sort({column:23, descending:false})
  }
  
  function onEdit(e){
  
    const row = e.range.getRow()
    const column = e.range.getColumn()
  
    if(!(column === 23 &amp;&amp; row &gt;= 2)) return
    
    autoSort()
  }
  
  function onEdit(event) {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var s = event.source.getActiveSheet();
    var r = event.source.getActiveRange();
  
    if(s.getName() == "Installation" &amp;&amp; r.getColumn() == 28 &amp;&amp; r.getValue() == "Completed") {
      var row = r.getRow();
      var numColumns = s.getLastColumn();
      var targetSheet = ss.getSheetByName("Complete");
      var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
      s.getRange(row, 1, 1, numColumns).moveTo(target);
      s.deleteRow(row);
    }
  }</code></pre>
  </div>
  </div>
  </p>