title: How to connect autoincrement with auto_date_stamp
body: <p>I have autoincremment in my google scripts. I would like add script with fixed timestamp. And connect with auto_increment in one time.</p>
  
  <p>I started auto_increment script and next I start insert_timestamp</p>
  
  <pre><code>function auto_increment() {
  
    var AUTOINC_COLUMN = 0; //start column
    var HEADER_ROW_COUNT = 340;// start row
  
    var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
    var worksheet   = spreadsheet.getSheetByName("Sheet 1");
    var rows        = worksheet.getDataRange().getNumRows() - 1;
    var vals        = worksheet.getSheetValues(1, 1, rows+1, 2);
  
    for (var row = HEADER_ROW_COUNT; row &lt; vals.length; row++) {
      try {
        var id = vals[row][AUTOINC_COLUMN];
        Logger.log(id);Logger.log((""+id).length ===0);
        if ((""+id).length === 0) {
          // Here the columns &amp; rows are 1-indexed
          worksheet.getRange(row+1, AUTOINC_COLUMN+1).setValue(row);
        }
      } catch(ex) {
        // Keep calm and carry on
      }
    }
  }
  
  
  function insert_timestamp() { //function onEdit() I cannot because I need fixed date one day
    var s = SpreadsheetApp.getActiveSheet();
    var r = s.getActiveCell();
    var tz = Session.getScriptTimeZone();
    if( r.getColumn() != 0 ) {
      var row = r.getRow();
      var time = new Date();
      time = Utilities.formatDate(time, tz, "dd.MM.yyyy");//"dd.MM.yyyy hh:mm:ss");
      SpreadsheetApp.getActiveSheet().getRange('C' + row.toString()).setValue(time);
    }
   }
  </code></pre>
  
  <p>When I write on cell "E" scripts insert new ID and timestamp "dd.mm.yyyy" and fixed when I change text in cell "E" date fixed the last.</p>
  
  <p>Thank you for your help</p>