google-apps-script-libraries

Calling library function from html in that library

筅森魡賤 提交于 2020-07-10 10:42:55
问题 In order to share with my colleagues the AppsScript code I am developing, I created a standalone project used as a library in our Docs template. This library contains: a .gs file for the server side code a .html file for the client side sidebar In the sidebar, I have a button which triggers a call to a function from the library with a parameter. The javascript call is the following: google.script.run .withFailureHandler( function(msg, element) { showError(msg, $('#button-bar')); }) .test(); I

How can I reference a Google Apps Script .html file from another library?

自闭症网瘾萝莉.ら 提交于 2020-06-28 11:03:20
问题 I'm writing a set of HTML pages that will be served on the Google Sheets sidebars and will connect to our internal database. Each page is set up on its own .html file within a single Google Apps Script project. I'd like to pull these files out to a single project and reference this as a library like I can do with my other .gs script files. Specifically, how can I write the "MyLib.page" line below? Library project: Code.gs function myFunc() { Logger.log("Hallo Werld!");} page.html <h1> Hello