I want to copy the values generated by a complex scripted query to another sheet, for users to work on without deleting the original query.
The query generates a variable range of data, depending on parameters passed, so I cannot hard code the range to copy. But it seems the problem is more complex than that...
I tried to pick the range using GetDataRange(); that returns an error (TypeError: Cannot call method "getDataRange" of null.).
// copy data to dashboard: var dashTab = thisSht.getSheetByName("Dashboard"); dataTab.getDataRange().copyTo(dashTab.getRange('A5'), PASTE_VALUES, false);
Checking that there is data there:
var dataRange = dashTab.getRange('B6'); Logger.log(dataRange);
shows an empty array [] in the log.
So how can I do this?