In GAS, I have a 2d array that I have populated with data and after the function runs I want to be able to push that data into a single column in a Google Sheet. I keep getting an error that the number of rows in the data doesn’t match the number of rows in the range. Looking for some extra eyes to tell me what I’m doing wrong.
var allExpensesStatus = [];
for (i = 0; i < somevar.length; i++)
{
allExpensesStatus.push([i,"some text"]);
}
spreadsheet.getSheetByName("MySheet").getRange("H2:H" + allExpensesStatus.length).setValues(allExpensesStatus);
Thank you in advance for your help!