1
votes

I'm trying to build a rather unique google sheets addon. Google's documentation is great for adding custom functions, however I want my addon to programmatically add custom functions.

For instance, the following doesn't seem to be possible:

  • Assume there's a getScript() custom function where if you do getScript("scraper"), this custom function will do an HTTP call and install a new function scraper() in your google sheet.
  • Then you can do scraper("https://www.google.com") to get all the text from "google.com".

I know it's possible to define scraper() ahead of time.

Is it possible to do so live?

1
No, that's not possible. You have define all your custom functions ahead of time. - Henrique G. Abreu
Ahh that's annoying. Would be nice to dynamically add to list of custom functions. - bumpkin

1 Answers

1
votes

The Google Apps Script platform have changed a lot since this question was posted back in 2014. Regarding editor add-ons they can't add random custom functions but they could send parameters to an external API that might include a function name and the required parameters by that function by using UrlFetchApp.