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

前端 未结 1 1655
一生所求
一生所求 2020-12-16 08:55

I am building some google apps scripts and want to load a javascript file located on one of my servers and be able to execute it\'s functions in Google Apps Script.

相关标签:
1条回答
  • 2020-12-16 09:25

    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.

    0 讨论(0)
提交回复
热议问题