title: How to send values from a user interface created using HtmlService to a google spreadsheet
body: <p>I have a form created using the google scripts HtmlService. I need to send the data captured once the form is submitted to a google spreadsheet, so I need to communicate withe the script on the server side. I have been following the google documentation on <a href="https://developers.google.com/apps-script/html_service" rel="nofollow">HtmlService</a>, and from the documentation, I have come out with this sample code, at least to test the calling of a  function on the server from the html using google.script API, but it doesn't work for me:</p>
  
  <p>The google Apps Script:</p>
  
  <pre><code>function doGet(e) {
    Logger.log("Creating page...");
    return HtmlService.createTemplateFromFile("myFile").evaluate();
  }
  
  function test() {
    return "Testing";
  }
  </code></pre>
  
  <p>And the html file:</p>
  
  <pre><code>&lt;html&gt;
    &lt;SCRIPT&gt;
      function evaluate(form) {
        var a = google.script.run.test();
        form.fieldName.value = a;
      }
    &lt;/SCRIPT&gt;
      &lt;form&gt;
         &lt;INPUT type = text name ="fieldName" class = "input_field" &gt; 
         &lt;INPUT TYPE="button" NAME="buttonSubmit" Value="Guardar"    onClick='evaluate(this.form)' &gt;
    &lt;/form&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>¿Whats wrong with this code? Any insights on this would be really appreciated, or alternative ways to do this.</p>