Maybe you should write this:
outputSheet.getRange("A94:A" + (94 + outputRange.length - 1)).setValues(outputRange);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to automate an End of Day report, one of the things I want it to do is take information from a Jira CSV, like bug numbers, summaries, ect, and put all that in a predefined area in the EoD sheet.
However, whenever I try to have my script set the values of the cells in A94:A244 I always get this error:
Line 16: Range setValues: The number of rows or columns in the input array doesn't match the size or dimensions of the range.
Yet, if I change the range being set to A1:A, it sets the cell values correctly.
Could I please get some help understanding what I am doing wrong?
This is my script
function main(workbook: ExcelScript.Workbook) {
let jiraSheet = workbook.getWorksheet("Jira");
let outputSheet = workbook.getWorksheet("EoD");
let outputRange = [] = [];
let bugSourceRange = jiraSheet.getRange("B2:B152").getValues();
for (let i = 0; i < bugSourceRange.length; i++) {
let bugString = bugSourceRange[i][0] as string;
let prefix = bugString.substring(0, 3);
if (prefix == "X") {
outputRange.push(bugSourceRange[i]);
}
}
outputSheet.getRange("A94:A244" + outputRange.length).setValues(outputRange);
}
Maybe you should write this:
outputSheet.getRange("A94:A" + (94 + outputRange.length - 1)).setValues(outputRange);