Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I have a form for internships and I am passing over the address of the internship provider to a function which gives me latitude and longitude for it, which is then consumed by a webmap using tabletop to leaflet.

The function works like this:

function getLat(address) {
  if (address == '') {
    Logger.log("Must provide an address");
    return;
  }
  var geocoder = Maps.newGeocoder();
  var location;
  // Geocode the address and plug the lat in the result
  location = geocoder.geocode(address);
  // Only change cells if geocoder seems to have gotten a
  // valid response.
  if (location.status == 'OK') {
    lat = location["results"][0]["geometry"]["location"]["lat"];
    return lat;
  }
};

My problem: I am only having 15 entries in the result spreadsheet but it gives me already the error Service invoked too many times for one day: geocode. (line 10, file "Code"). The function is working for new entries as I am only using =GetLat(B13) as an example.

My question: is there a way to store the result of a succesfull function result, like using =continue(A2,2,1) instead of copy-pasting of the getLat/getLon function to the one-hundred rows of the spreadsheet or to prevent the reevaluation of the function after some time?

(You can find the document here.)

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

So the solution is the correct usage of project triggers. you can use them to control the webapp to run only on form submit:enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.