I am getting the following error in my Sheets Add-on:
Service invoked too many times for one day: urlfetch
I\'m aware of the limits here, but h
You currently can not do it.
Perhaps run a counter in your script.
I have run into that too. I only have 1000 rows going out to a web service. Data did not change neither in my sheet nor in the service. But at some point today most of my cells show #Error with this cause.
I feel like it's going out to re-fetch the results way too often. Is there not some caching that can be employed?
UPDATE (long time due): adding cache was exactly what was needed. So I implemented a function fetch(url)
which uses a cache and that way avoids the replicate calls.
function fetch(url) {
var cache = CacheService.getScriptCache();
var result = cache.get(url);
if(!result) {
var response = UrlFetchApp.fetch(url);
result = response.getContentText();
cache.put(url, result, 21600);
}
return result;
}