title: Google form update response options instead of creating a new row
body: <p>I would like to edit a response option instead of adding a new response if the timestamp is already present in the reponse spreadsheet.
  This is what i have tried.</p>
  
  <pre><code>function trial(event) {
  
    var email = "xxxx@gmail.com";
    var ss = SpreadsheetApp.getActiveSheet();
    var data = ss.getDataRange().getValues();
    var body = '';
  
    //Comapring timestamp in each row with the timestamp entered in the form
    var i = 0;
    while(i &lt; data.length) {
      if(data[i][0].toString() ==  event.namedValues['Timstamp'].toString()){
        body += '\n The row number: ' + i;
        data[i][1] = 'ADDDDDDD';
        data[i][2] = event.namedValues['Status'].toString();
        ss.deleteRow(event.range.getRow());
      }
      i++;
    }
  
  
  
    var subject = "Delete Test";
    GmailApp.sendEmail(email, subject, body);
  
  }
  </code></pre>
  
  <p>I am entering the timestamp in the form as a value(I took care of passing the appropriate timestamp, user need not enter it; it would be prefilled). Now if there is a match, it deletes the new response but does not modify the old one. Can anyone point out my mistake.</p>