r/GoogleAppsScript • u/MinosAristos • Sep 03 '23
Question How do I easily share Apps Script custom functions across many Google Sheets?
So I've developed some Google Sheets functions and custom formulas in Apps Script that perform operations that aren't possible (or maybe are too complex) with built-in formulas.
Whenever I create a new spreadsheet I want to be able to quickly / seamlessly be set up with these formulas ready to go.
I thought the Libraries feature would be perfect for this, but that requires retrieving the ID every time, and also writing wrapper functions for all the ones I want to use in formulas.
I also considered creating a Sheets Add-On but while it sounds like that would work, it seems excessively complex for something that feels like it should be simple.
Finally I thought of just copying some kind of template sheet that has the formulas written there. That works and I'll use that if there isn't a better way, but ideally I want to be able to update my scripts and have the updates still be accessible from all the client sheets.
Is there an easier way that I've missed? Some way to quickly import apps script dynamically and be able to access formulas from the import out of the box?
4
u/SaysCraigDiscGolf Sep 03 '23
Add-on is exactly what is designed to help with this. But look into saving it as a web app then finding a way to access it from each sheet.
4
u/arnoldsomen Sep 03 '23
How about a template that uses a library?
Otherwise, add on.