Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling a Google App Script library from a Google spreadsheet cell

Trying out the new library feature in a Google spreadsheet. I have include a library with the identifier of "Test" and the library implements the function "foo()"

entering =Test.foo() into a spreadsheet cell gives the error : "unknown function name TEST.FOO"

If I create a function in my spreadsheet to wrap the library function:

function foo()
{
  return Test.foo();
}

then use =foo() in my speadsheet cell, all is well. Creating wrapper functions for all library functions so they can be used in a spreadsheet cell makes using libraries less than ideal. Is there a way to call a library function from a spreadsheet cell?

like image 814
Hilo Avatar asked Feb 20 '23 08:02

Hilo


1 Answers

There's not currently a way to call these library functions directly as a custom function from a cell. Creating a wrapper, as you've done, is the way to do this currently. If you'd like to be able to call library functions directly as custom functions, please raise that as an issue on the Issue Tracker.

like image 100
Jan Kleinert Avatar answered May 03 '23 19:05

Jan Kleinert