title: Reading data in Google Sheets and passing data to custom dropdown menu
body: <p>I have a custom Dropdown menu in Google Sheets. I'd like to pass information from a sheet into the dropdown.
  (see the screenshot for data)</p>
  <p>After updating my code thanks to @Cooper, and running the displayDropdown function, I am successfully logging the data. So it IS reading the data... But, it is not being populated in the dropdown.
  What (obvious) step am I missing here?!</p>
  <p><strong>myDropdown.html</strong>:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;base target=&quot;_top&quot;&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;form&gt;
      &lt;div class=&quot;select-style&quot;&gt;
        &lt;select id=&quot;dropJob&quot;&gt; 
          &lt;?!= getDays(); ?&gt;
        &lt;/select&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p><strong>Code.gs</strong>:</p>
  <pre class="lang-js prettyprint-override"><code>function displayDropdown()
  {
       var htmlDlg = HtmlService.createHtmlOutputFromFile('myDropdown')
                .setSandboxMode(HtmlService.SandboxMode.IFRAME)
                .setWidth(350)
                .setHeight(250);              
       SpreadsheetApp.getUi()
                 .showModalDialog(htmlDlg, &quot;title&quot;);
       return HtmlService.createTemplateFromFile('myDropdown').evaluate();    
  }
  
  function getDays() 
  {
    var ui = SpreadsheetApp.getUi();
    var active = SpreadsheetApp.getActive();
    var sheet = active.getSheetByName(&quot;Days&quot;);
    var myRange = sheet.getRange(&quot;A1:A7&quot;); 
    var data    = myRange.getValues();
    var optionsHTML = &quot;&quot;;
    for (var i = 0; i &lt; data.length; i++) {
      optionsHTML += '&lt;option&gt;' + data[i][0] + '&lt;/option&gt;';
    };
    Logger.log(optionsHTML);
    return optionsHTML;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/7z3Ih.png" rel="nofollow noreferrer">google sheet data</a></p>