ImportJSON icon indicating copy to clipboard operation
ImportJSON copied to clipboard

How to refresh / update data in cell?

Open drewclifton opened this issue 4 years ago • 2 comments

Is there a way to make sure that the data showing in the cell is actually current?

Does reloading the web page (spreadsheet) fetch new data?'

The only way I see* is to actually edit the URL to something else, but that's not practical as I have a number of URLs on my sheet that I am pulling data from.

*I'm just going off of how to get the word "Loading..." to appear, which I assume means it's fetching data...

Thanks

drewclifton avatar May 19 '21 20:05 drewclifton

I would like to get the data showing in the cell is actually current too.

setthawut8 avatar Jan 03 '22 07:01 setthawut8

This worked for me. It adds a time stamp each time it updates.

https://www.youtube.com/watch?v=ylH_7i4hLwc

function importJSONupdate() { var randChange= Math.random(); var d = new Date(); var timeStamp = d.toLocaleTimeString(); var cellValue = '=ImportJSONBasicAuth("[https://acumatica.conciseit.net/Odata)","","", "/value", "noInherit, noTruncate","' + timeStamp + '")'; SpreadsheetApp.getActiveSheet().getRange('A1').setValue(cellValue);

}

maddietodd avatar Jan 27 '23 17:01 maddietodd