title: HTML Service - Dropdown option list from GSheet
body: <p>Into Google Apps script and HTML service</p>
  
  <blockquote>
  <pre><code>Code.gs 
  function doGet() {
    return HtmlService.createTemplateFromFile('HTMLUI').evaluate()
    .setSandboxMode(HtmlService.SandboxMode.NATIVE);
  }
  </code></pre>
  </blockquote>
  
  <p>Here is HTML </p>
  
  <pre><code>HTMLUI.html
  
  &lt;script type="text/javascript"&gt;&lt;/script&gt;
  &lt;script&gt;
  &lt;?
    var sheet   = SpreadsheetApp.openById("0Avt7ejriwlxudGZfV2xJUGJZLXktQ2RhQU1uRUgtaXc").getSheetByName("MRF Tab");
    var lastRow = sheet.getLastRow();  
    var myRange = sheet.getRange("C3:C"+lastRow); 
    var data    = myRange.getValues();
  ?&gt;
  &lt;/script&gt;
  &lt;select&gt;
  &lt;? for (var i = 0; i &lt; sourcedata.length; ++i) { ?&gt;
  &lt;option&gt;&lt;?!= sourcedata[i] ?&gt;&lt;/option&gt;
  &lt;? } ?&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I had this code in one of my project (and a lot more code) which basically captures information form the sheet and add it to the options (dropdown) in select, but when trying this same code in new project this isnt working, any ideas what am I missing.</p>
  
  <p>At present the result displayed is a dropdown box with <code>&lt;?!=sourcedata[i]?&gt;</code></p>
  
  <p>How can I correct this. Any help please.</p>
  
  <p>EDIT:---</p>
  
  <p>Please have a look @ comment no 3 for link to a spreadsheet and some workaround with it...</p>