How to expose an Appscript ServerFunction to the user for attaching as a script?
pradeep-gox opened this issue · comments
Hi there,
I would like to expose an Appscript server function (eg., openSidebar) to the user, so that when the user installs my add-on, instead of launching the sidebar ui from Extensions drop-down, I would like to create a button in a sheet and attach the script function openSidebar to it. So when the user clicks the button, it should launch the sidebar ui.
Any help would be appreciated 👍
The docs explain how to do this. You could type in for example openAboutSidebar
under "Assign script" if you are using this boilerplate.
https://developers.google.com/apps-script/guides/menus#clickable_images_and_drawings_in
I am able to do it in development. I think its because of the 'clasp push' to the appscript attached to my development spreadsheet. But when I install my add-on from the marketplace (production), the function is not available to be used on any spreadsheet.
Found that I should make the script access visible to everyone to achieve this.
Btw thanks for your support 🙂