title: Passing a searchterm from webapp show results
body: <p>I have a custom function that works searching Drive. I am trying to get the web app to pass the searchterm to the custom function and return the results. </p>
  
  <p>Currently, when I test the function in the logger it works and returns the files. </p>
  
  <p>In the example below I have a hello world working- but as mentioned earlier I haven't been able to pass the searchterm from the input form.</p>
  
  <p><strong>CODE.GS</strong>
  <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 SearchFiles() {
  
  var searchterm ="'YOUR SEARCHTERM'";  // this would be the variable that is passed from the form on index.html
  var searchFor ="title contains " + searchterm;
  var owneris ="and 'emailaddress@goeshere.com' in Owners";
  var names =[];
  var fileIds=[];
    Logger.log(searchFor + " " + owneris);
  var files = DriveApp.searchFiles(searchFor + " " + owneris);
  while (files.hasNext()) {
    var file = files.next();
    var fileId = file.getId();// To get FileId of the file
    fileIds.push(fileId);
    var name = file.getName();
    names.push(name);
  
  }
  
  for (var i=0;i&lt;names.length;i++){
  Logger.log(names[i]);
  Logger.log("https://drive.google.com/uc?export=download&amp;id=" + fileIds[i]);
  
  }
  }
  
  function doGet(e) {
    var template = HtmlService.createTemplateFromFile('Index');
    return template.evaluate()
        .setTitle('Hello World')
        .setSandboxMode(HtmlService.SandboxMode.IFRAME);
  }
  
  function parseDataFromAppscript()
  {
    return "Hello World!";
  }
  
  function processForm(formObject) {
  Logger.log('I was called!');
   // here is where I would like to display results of searchterm.
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>INDEX.HTML</strong></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>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;base target="_top"&gt;
      &lt;script&gt;
      function displayMessage()
      {
      google.script.run.withSuccessHandler(helloWorld).parseDataFromAppscript();
      }
  
      function helloWorld(stringText)
      {
      document.writeln(stringText);    
      }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;input type="text" name="search"&gt;   
      &lt;input type="button" value="submitButton" name="submitButton" onclick="displayMessage()"/&gt;
   
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>