title: Importing Google Apps Script form submission into existing Spreadsheet
body: <p>I have a Google Drive with a folder called "Submissions".
  I also have a Google Apps script which both creates a 'form' as well as depositing what the end-user has uploaded (from the form) into the submissions folder.</p>
  
  <p>Here is an example of the script (server.gs):</p>
  
  <pre><code> function doGet(e) {
    return HtmlService.createHtmlOutputFromFile('form.html');
  }
  
  function uploadFiles(form) {
  
    try {
  
      var dropbox = "Submissions";
      var folder, folders = DriveApp.getFoldersByName(dropbox);
  
      if (folders.hasNext()) {
        folder = folders.next();
      } else {
        folder = DriveApp.createFolder(submissions);
      }
  
      var blob = form.myFile;    
      var file = folder.createFile(blob);    
      file.setDescription("Uploaded by " + form.myName);
  
      return "File uploaded successfully " + file.getUrl();
  
    } catch (error) {
  
      return error.toString();
    }
  
  }
  </code></pre>
  
  <p>And the Form.html is as follows:</p>
  
  <pre><code>&lt;form id="myForm"&gt;
  
  &lt;label&gt;Name:&lt;/label&gt;
  &lt;input type="text" name="myName"&gt;
  
  &lt;label&gt;Email:&lt;/label&gt;
  &lt;input type="text" name="myEmail"&gt;
  
  &lt;label&gt;Demo Title (e.g "Artist - Demo Name"):&lt;/label&gt;
  &lt;input type="text" name="myTitle"&gt;
  
  &lt;label&gt;Choose Demo File:&lt;/label&gt;
  &lt;input type="file" name="myFile"&gt;
  
  &lt;input type="submit" value="Submit" 
             onclick="google.script.run
                      .uploadFiles(this.parentNode);
                      return false;"&gt;
  </code></pre>
  
  <p></p>
  
  <p>What this does is create a form which has "Name", "Email", "Demo Title" text fields as well as a "Submit" button. The user attaches a file and uploads the file using this form.</p>
  
  <p>Now the file upload works absolutely fine. Anyone can upload a file and it will appear in a folder (Submissions) on my google drive correctly... However, the other details simply vanish as if they were never entered. I want THOSE details to appear in an existing spread sheet with preferably a timestamp.</p>
  
  <p>Can anyone help me?</p>