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 column in Google Spreadsheet that calls an outside webservice using URLFetch in a Google Script. The cell uses two parameters in that cell's row. After a change occurs where those two parameters will return a different value if sent to the webservice again the cell retains a cached value. I know it is cached because if I copy and paste the row to another row, the webservice calculated values change to the correct ones.

Is there a way to force a row or a cell in a Google Spreadsheet to recalculate its value, especially if it is using an outside webservice in a custom fucntion?

share|improve this question
    
I do know that I can refresh all of the cells by either editing the script or sorting the data, but I am looking for something a little more fine tuned. –  capn Jul 24 '12 at 17:13
    
Have you tried F5? –  Jacob Jan Tuinstra Nov 25 '12 at 8:45
    
Yep, and ctrl-F5, just started closing and reopening when I needed it refreshed, didn't think about that when I was first adding all the data. After it became more of an add a line every few days file it didn't become as big of a deal. –  capn Feb 25 '13 at 16:15
add comment

1 Answer 1

up vote 3 down vote accepted

Add the following line of code:

SpreadsheetApp.flush()

See reference: flush

share|improve this answer
    
Until there is a command that will flush a single cell, column, or row, I guess this is the heavy handed approach I will have to use. Its best to call it as needed for me in a single cell manually when I want all the data refreshed (F5 and ctrl-F5 does not do this, only opening and closing it will), since calling it each time would probably cause some unintended looping and duplication of work when the sheet is first opened. –  capn Feb 25 '13 at 16:14
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.