title: How to generate an "id" on WEB google App Script?
body: <p>I have this script to insert data into the spreadsheet.</p>
  <p>I created a way to generate an ID with the value of the date and time, the problem that is too large</p>
  <p>example: <code>E1567301439829</code></p>
  <p>Is there any way I can generate a unique and short ID for each record?</p>
  <p>I would like to leave an id like: <code>E001, E002, E003....</code></p>
  <p>Link Ws: <a href="https://docs.google.com/spreadsheets/d/1OokFvWCx-ROkhaLP1nYQPDAu8zgCTeizHHq0ABnBL0A/edit#gid=0" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1OokFvWCx-ROkhaLP1nYQPDAu8zgCTeizHHq0ABnBL0A/edit#gid=0</a></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-js lang-js prettyprint-override"><code> function doGet(e){
    Logger.log(e.parameter);
    return HtmlService.createHtmlOutputFromFile("index");
    
  }
  
  function registrar(name){
    var url = "https://docs.google.com/spreadsheets/d/1OokFvWCx-ROkhaLP1nYQPDAu8zgCTeizHHq0ABnBL0A/edit#gid=0"
    var ss = SpreadsheetApp.openByUrl(url);
    var ws = ss.getSheetByName("Página1");
    
    
    var date = new Date().valueOf();
    var idEntrada = 'E' + date
    
    ws.appendRow([idEntrada,name]);
    
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
    &lt;head&gt;
      &lt;base target="_top"&gt;
    &lt;/head&gt;
    &lt;body&gt;
      
      
      &lt;label&gt;Nome&lt;/label&gt;&lt;input type="text" id="nome"&gt;
      
      &lt;button id="btn"&gt;Registrar&lt;/button&gt;
      
      &lt;script&gt;
      
      document.getElementById("btn").addEventListener("click",salvar);
      
      function salvar(){
      
         var campoNome = document.getElementById("nome").value;
         
         google.script.run.registrar(campoNome);
         
         document.getElementById("nome").value = "";
      }
      
      
      &lt;/script&gt;
      
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>