title: Passing variable from google script to html dialog
body: <p>I'm working on trying to do some error prompts in the case someone doesn't put in a value. In the case I check if the value is empty, and will eventually check if it's a date.</p>
  
  <p>So when here is the run down.</p>
  
  <p>1) Run the if statement, if the value is true, run the error prompt with the string argument </p>
  
  <pre><code>if (sheetData[4] === ""){
    errorPrompt("Title");
  }
  </code></pre>
  
  <p>2) Run the below function with the string argument. I then want the function to pass the argument to the html iframe.</p>
  
  <pre><code>function to open dialog
  function errorPrompt(missvar) {
    var missVar = "test";
    var html = HtmlService.createHtmlOutputFromFile('missingvar')
        .setSandboxMode(HtmlService.SandboxMode.IFRAME);
    SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
        .showModalDialog(html, missVar + ' is Missing please provide ' + missVar + " and try again.");
  }
  </code></pre>
  
  <p>3) the variable should then pass along to the html file which is displayed as a modal dialogue. Provided the string is equal to "Title", the dialogue should read: "The <strong>Title</strong> is missing. Please enter <strong>Title</strong> and try again."</p>
  
  <p>missingvar.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;base target="_top"&gt;
    &lt;/head&gt;
    &lt;body&gt;            
          &lt;script&gt;
          UI.getElementById("missVar").innerHTML;
          &lt;/script&gt;
  
         The &lt;var id=missVar&gt;&lt;/var&gt; is missing. Please enter &lt;var id=missVar&gt;&lt;/var&gt; and try again.
      &lt;input type="button" value="Close"
          onclick="google.script.host.close()" /&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The HTML above displays, however the missVar doesn't show. Anyone have any thoughts? just to note, the title bar of the dialog box is correctly displaying the variable, but that's outside of the html.</p>