-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Auto refresh on sheet reload? #59
Comments
For example to refresh one or more cells each minute I'm using this trick step by step :
I hope it will help you. ;) |
code 👍 var cellFunction1 = '=IMPORTJSON(“' + SpreadsheetApp.getActiveSheet().getRange('A50').getValue() + '?' + queryString + '”,”'+ SpreadsheetApp.getActiveSheet().getRange('B50').getValue() + '”,”noInherit,noTruncate”)'; |
Thanks but none of the above solutions are generic enough to be used as a standard addition to the script itself... I'm looking more in terms of a |
I am also facing same issue, When i am able to modify the cell that time only i can able to get the data. My data provider given every 1 min dynamic data . How can i handle any solutions or workarround My Opensource lib:- My API Provider:- Screenshot:- Any one have idea means please suggest regards, |
Hi @TriMoon you got any solutions ? |
I have this call how can i pass? Every 1 minute need to update =ImportJSON("https://www.nseindia.com/live_market/dynaContent/live_watch/stock_watch/foSecStockWatch.json") |
I tried something hacky but ran into permission issues: function importJSONAutoRefresh(url, query, parseOptions, cellSource) {
var random = Math.random();
url += '&random=' + random;
console.log(SpreadsheetApp.getActiveSheet().getRange(cellSource).getValue())
var refreshedImportJSON = 'importJSONWithRefresh("' + url + '", "' + query + '", "' + parseOptions + '", "' + cellSource + '")';
console.log(refreshedImportJSON);
SpreadsheetApp.getActiveSheet().getRange(cellSource).setValue(refreshedImportJSON);
} I added this function but I get |
@TriMoon @gsivaprabu I've written an article about how to refresh automatically a spreadsheet with ImportJSON. @bradjasper It requires some manual steps within the sheet itself to do the setup, but I think the process can be officially documented in this repository, if you wish to do so. Basically, it relies on a special sheet (in my example, but could be a special cell as well) to be auto updated using App Scripts and does a force refresh of all the ImportJSON referencing it. It can be used both to refresh the sheet upon "open" event, and at a predefined interval. |
Is there anyway to make this script load fresh data when the spreadsheet is reloaded by user instead of modifying the cell where the function is called?
I tried #57 but no luck on spreadsheet reload...
The text was updated successfully, but these errors were encountered: