Hello,
This is myArray in Power Automate:
[
"Code A, ,3000000,30,True",
"Code B, ,1000000,20,True"
]
I want to write this array in cell A1, of an Excel workbook.
This is my script:
function main(workbook: ExcelScript.Workbook, wsName: string, strArr: string) {
//Convert the strArr to an array
let newDataArr: string[][] = JSON.parse(strArr);
console.log(newDataArr);
//Declare and assign the worksheet
let ws = workbook.getWorksheet(wsName);
let startCell = ws.getRange("A1");
startCell.getAbsoluteResizedRange(newDataArr[0].length, newDataArr.length).setValues(newDataArr);
}
Which is returning the error:
Office JS error: Line 19: Range setValues: the argument is invalid.