title: How to update Sidebar in GAS
body: <p>I am coding an application for Google Sheets and when searching for duplicates in a sheet I want to inform the user. I was thinking of using Sidebar to do so. But the issue is that the content do Sidebar is always overwritten. I did search the net but did not find any simple solution for Google Sheet application.</p>
  <p>I guess I can use an variable that I would always update but what if want to update Sidebar anywhere in a complex GAS application?</p>
  <p>Also I do not like that the Sidebar disappears</p>
  <pre><code>function testSidebar(){
    var text = &quot;&lt;p&gt; New duplicate on the row&quot;;
    var htmlOutput = HtmlService
        .createHtmlOutput(text)
        .setWidth(250)
        .setHeight(300);
  
    for(var i=0; i &lt; 10; i++){
  
      Utilities.sleep(2000);
  
      if (isOdd(i)){
        text += &quot;&lt;BR&gt;- &quot;+i;
        htmlOutput = HtmlService
            .createHtmlOutput(text+'&lt;/p&gt;')
            .setWidth(250)
            .setHeight(300);
        SpreadsheetApp.getUi().showSidebar(htmlOutput);
      }
    }
  }
  </code></pre>