0

I'm just starting to use libraries in Apps Script. I can get libraries to work when the library code is referenced from a .GS file but the I cannot get libraries to work when accessing them via .HTML files (I get a message xxx is undefined)

Before I spend anymore time on this can anyone confirm that libraries are only for .GS files

thanks

0

2 Answers 2

1

You cannot call library functions directly, but if you create a function that calls library functions on the Google Apps Script side,

google.script.run.withSuccessHandler (onSuccess) .gasfunction ()

Can be called with

There are various uses.

Reference links:Library functions cannot be called directly

Sign up to request clarification or add additional context in comments.

1 Comment

Great, thank you. That has saved me hours of testing and scratching my head. I'll try that and see what the performance deficit is versus keeping the actual code in the .HTML if it's not much deficit it my be worth this approach for the saving in maintenance across the 20 scripts that use the library.
0

Html libraries are different from server script libraries. There is no point in using server side library in html. Even if it is defined, it'll be useless. You could however call the server library from html(client side) through google.script.run

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.