Gmail add-on html

47 views
Skip to first unread message

Vladisan Kim

unread,
Oct 18, 2021, 3:42:29 AM10/18/21
to Google Apps Script Community
Hello Community,

Is there any way to create a complex html content inside a CardSection. In particular, we need a tree view component to be rendered inside a CardSection.

Thank you

Clark Lind

unread,
Oct 19, 2021, 11:36:55 AM10/19/21
to Google Apps Script Community
It may be possible. See here.  Near the end is a callback function that incorporates html:

function authCallback(callbackRequest) {
  var authorized = getOAuthService().handleCallback(callbackRequest);
  if (authorized) {
    return HtmlService.createHtmlOutput(
      'Success! <script>setTimeout(function() { top.window.close() }, 1);</script>');
  } else {
    return HtmlService.createHtmlOutput('Denied');
  }
}

Which means, you may be able to replace " HtmlService.createHtmlOutput("<html>...")    with  HtmlService.createHtmlOutputFromFile("your HTML file").  
If you have success, please post your results! I'd be interested to see just what you can do.

dimud...@gmail.com

unread,
Oct 19, 2021, 3:57:21 PM10/19/21
to Google Apps Script Community
Unfortunately, that's not possible. See restrictions (from official documentation) linked below:

Vladisan Kim

unread,
Oct 21, 2021, 10:01:52 PM10/21/21
to Google Apps Script Community
Ok, guys, thanks
Reply all
Reply to author
Forward
0 new messages