Hi, I have the following piece of script to get rid of the zeroes that result from the transpose-function returning empty cells:
function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getActiveWorksheet();
// Set range A3 on selectedSheet
selectedSheet.getRange("A3").setFormulaLocal("=TRANSPOSE(IF(ISBLANK(A1:GG2);\"\";A1:GG2))");
}
It works fine when run from Excel in the browser (in the Automate tab), with this result in A3:
=TRANSPOSE(IF(ISBLANK(A1:GG2);"";A1:GG2))
But when Power Automate runs the same script with Excel's 'Run script'-action, it outputs the following formula in the sheet that its run on:
=TRANSPOSE(IF(ISBLANK(A1:GG2);;A1:GG2))
Thus, the double quotes and the formula returns zeroes after all. ‌‌
Any advise on how to maintain those double quotes and output the correct formula is very welcome!