I have a function on a google sheet that extrapolates data from an ESI and fills in rows and columns with said data. Since the data gets old and needs to be updated it would be handy to have a script to run that deletes all rows and columns (except A1 where function resides) of said sheet and re-runs the function so that it repopulates it with new data (effectively refreshing the sheet). If also possible to only let it execute at intervals greater or equal to 24 hours to not stress the data server.
Hope someone can help me out with this.
EDIT: managed to create function to refresh data and rerun custom function but not yet able to set a timeframe except with sleep command.
Making a google script I achieved this:
function refreshData() {
var app = SpreadsheetApp;
var sheet1 = app.getActiveSpreadsheet().getSheetByName("sheet1");
sheet1.getRange("A:K").clearContent();
sheet1.getRange("A1").setValue("=customFunction()");
//Utilities.sleep(1800000); - stops script for 30 minutes
}