UiApp has been deprecated. Please use HtmlService

2019-07-26 10:19发布

问题:

I have a google script that I'm using in google spreadsheet to export some data from there. Recently they update the spreadsheet and I'm getting this error:

UiApp has been deprecated. Please use HtmlService instead

var app = UiApp.createApplication().setTitle('Export');

Does anyone had this problem, any solution?

Thank you

回答1:

Starting point:

function openDialog() {
  var html = HtmlService.createHtmlOutputFromFile('export');
  SpreadsheetApp.getUi()
      .setWidth(640)
      .setHeight(400)
      .showModalDialog(html, 'Export');
}

Docs: https://developers.google.com/apps-script/guides/html/