title: What is the scope of variables available to google.script.run.myFunction()
body: <p>I'd like a little sanity check if I may.</p>
  
  <p>Can Javascript code in an HtmlOutput window floated over a Google spreadsheet alter variables and call methods in the gs code that created the HtmlOutput in the first place?</p>
  
  <p>I have a Google spreadsheet with a floating form created like this:</p>
  
  <blockquote>
    <p><em>someCode.gs</em></p>
  </blockquote>
  
  <pre><code>var theForm;
  var theSpreadsheet;
  function makeForm() {
      :
    theForm = HtmlService.createTemplateFromFile('aForm').evaluate();
    theSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();    
    theSpreadsheet.show(theForm);
      :
  }
  
  function recordTheForm(jsonFormData) {
      :
    theForm.clear();
      :
  }
  </code></pre>
  
  <p>Attached to a button in the HTML of "aForm.html" I have a function call back into the file "someCode.gs".</p>
  
  <blockquote>
    <p><em>aForm.html</em></p>
  </blockquote>
  
  <pre><code>  :
  google.script.run.recordTheForm(jsonTheForm);
    :
  </code></pre>
  
  <p>Am I right that, even though it was instantiated from someCode.gs, the caller of recordTheForm() can have no knowledge of the contents of that originating memory space?</p>
  
  <p>Is there anyway to get it? such as passing a "context" back and forth?</p>