title: How send result to HTML Template From File
body: <p>How can I send the  function result to HTML Template From File, with below effort I am getting an object Object error message</p>
  <p>Error in HTML Page is : [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function doGet() {
   var ss = SpreadsheetApp.openById("IIIIIII");
      var sheet = ss.getSheetByName('Sheet3')
      var values = sheet.getDataRange().getValues();
      var msg = [];
  
      var MyDate =  e.parameter.time;// 7/27/2020
      var d = new Date(MyDate);
      var n = d.getTime();
      for (var i = 0; i &lt; values.length; i++) {
          if (new Date(values[i][0]).getTime() === n) {
              msg.push(values[i][1])
          }
      }
  
  const ts = ['10:00-11:00', '11:00-12:00', '12:00-13:00', '13:00-14:00', '14:00-15:00', '15:00-16:00', '16:00-17:00', '17:00-18:00', '18:00-19:00'],
          booked3 = msg,
          avail = (ts, booked) =&gt;
          ts.map(item =&gt; {
              const [start, end] = item.split('-'),
                  isBooked = !booked
                  .map(item =&gt; item.split('-'))
                  .every(([bookedStart, bookedEnd]) =&gt; bookedStart &gt;= end || bookedEnd &lt;= start)
              return {
                  slot: `${start}-${end}`,
                  isBooked
              }
          })
  console.log(avail(ts, booked3))
        
  var template
  var template =HtmlService.createTemplateFromFile('index'); 
       template.name= e.parameter.time;
       template.idata=avail(ts,booked3); // this result is showing in html page 
       var pageData= template.evaluate()
      .setTitle('System') 
      .setSandboxMode(HtmlService.SandboxMode.IFRAME) 
      .addMetaTag('viewport', 'width=device-width, initial-scale=1')
      .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL) 
       return pageData;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="text-white display-6"&gt;idata:&lt;?= idata; ?&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://i.stack.imgur.com/3QAHj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3QAHj.png" alt="Google Sheet " /></a></p>