How to load javascript from external source and execute it in Google Apps Script

You can do this:

eval(UrlFetchApp.fetch("my url").getContentText())

Although it would be a lot faster/more efficient to cache the code in ScriptDb or CacheService and only fetch it fresh every 15 minutes or so.

Leave a Comment