title: how to prevent reading while writing?
body: <p>I have deployed a network application for my client to post their data to my spreadsheet.</p>
  
  <p>Each time they post a set of data, my applicantion will write them into the last row of my sheet.</p>
  
  <pre><code>var sheet = SpreadsheetApp.getActive().getActiveSheet();
  var index = sheet.getlastRow();
  sheet.getRange(index,1,1,10).setValues(data);
  </code></pre>
  
  <p>The problem is when more than one people use this applicant at a moment,it may get the same lastRow,and some data will missing.</p>
  
  <p><strong><em>like this :</em></strong></p>
  
  <p><strong>1. A read lastRow n</strong></p>
  
  <p><strong>2. B read lastRow n (before A write)</strong></p>
  
  <p><strong>3. A write at row n</strong></p>
  
  <p><strong>4. B write at row n (and A's data missing)</strong></p>
  
  <p>Is their any solution to fix this problem?</p>
  
  <p>Or is their any way to prevent reading while another is reading?</p>