javascript - Google Sheets JSON Error: "Service invoked too many times for one day:" -
i have convert longitude , latitude, useful address (reverse geocode), found script @ [geo scipt][1]
i having issue many requests per day, question how can have run once (when data imported ifttt) , not every time open google sheet?
function getlat(address) { if (address == '') { logger.log("must provide address"); return; } var geocoder = maps.newgeocoder(); var location; // geocode address , plug lat, lng pair // 2nd , 3rd elements of current range row. location = geocoder.geocode(address); // change cells if geocoder seems have gotten // valid response. if (location.status == 'ok') { lat = location["results"][0]["geometry"]["location"]["lat"]; return lat; } }; function getlon(address) { if (address == '') { logger.log("must provide address"); return; } var geocoder = maps.newgeocoder(); var location; // geocode address , plug lat, lng pair // 2nd , 3rd elements of current range row. location = geocoder.geocode(address); // change cells if geocoder seems have gotten // valid response. if (location.status == 'ok') { lng = location["results"][0]["geometry"]["location"]["lng"]; return lng; } }; function getadd(lat, lng) { // return address taking coordinates , reverse geocoding. if (lat == "") { return "you have provide latitudinal coordinates place" } if (lng == ""){ return "you have provide longitudinal coordinates place" } var response = maps.newgeocoder().reversegeocode(lat, lng); //call reverse geocode service (var = 0; < response.results.length; i++) { var result = response.results[i]; return result.formatted_address; //output full address in cell utilities.sleep(math.random() * 500); } };
the service invoked many times 1 day
indicates given service exceed total allowable execution time 1 day. commonly occurs scripts run on trigger, have lower daily limit scripts executed manually. instead of google sheet, try use fusion tables
each time custom function used in spreadsheet, google sheets makes separate call apps script server. if spreadsheet contains dozens (or hundreds, or thousands!) of custom function calls, process can quite slow. helpful read map data maps api , fusion table
if script reaches quota or limitation, throw exception message, more information regarding this, follow link: https://developers.google.com/apps-script/guides/services/quotas#current_limitations
Comments
Post a Comment