Sorry I can't actually comment the following answer because I'm too low on reputation.
I'm actually trying to implement the solution of "ken" from Write an array of values to a range of cells in a spreadsheet
I want get my array ["Adam","Barb","Chris"] to appear on 3 differents lines.
Which is:
function addArrayToSheetColumn(sheet, column, values) {
const range = [column, "1:", column, values.length].join("");
const fn = function(v) {
return [ v ];
};
sheet.getRange(range).setValues(values.map(fn));
}
const ss = SpreadsheetApp.getActiveSpreadsheet();
const cache = ss.getSheetByName("_cache_");
const results = ["Adam","Barb","Chris"];
addArrayToSheetColumn(cache, "A", results);
I get the error:
TypeError: Cannot read property 'length' of undefined
But as it points to the function, I don't get why the error appear.