Reputation: 117
Let us say I have an importdata function that refreshes every day and returns a table of 10 rows. Is there a function that allows me to log the data of the cells into another part of the workbook? So theoretically after a couple of weeks, I would have historical data automatically.
Upvotes: 1
Views: 47
Reputation: 5533
You can use Google Apps Script to copy and paste data to another sheet and create an Installable Triggers with event source of time-driven that will schedule the execution of script.
This script will append data from Sheet1 to Sheet2:
Code:
function myFunction() {
var sh = SpreadsheetApp.getActiveSpreadsheet();
var sh1 = sh.getSheetByName('Sheet1');
var sh2 = sh.getSheetByName('Sheet2');
var data = sh1.getDataRange().getValues();
sh2.getRange(sh2.getLastRow()+1, 1, data.length, 1).setValues(data);
}
Sheet1:
Sheet2:
Output:
This trigger will run the script every 12MN to 1AM everyday.
Upvotes: 2