admin管理员组文章数量:1181894
Can you help me, how can i return a function in office script that returns an array with: a mail, and 2 array of row ranges:
the return i need is (if possible )
[["[email protected]"],["Estac","22Jan","23Jan","24Jan","25Jan"],["448 - RRHH","","R","R",""]]
Can you help me, how can i return a function in office script that returns an array with: a mail, and 2 array of row ranges:
the return i need is (if possible )
[["[email protected]"],["Estac","22Jan","23Jan","24Jan","25Jan"],["448 - RRHH","","R","R",""]]
Share
Improve this question
asked yesterday
David Ricardo Menacho VadilloDavid Ricardo Menacho Vadillo
1157 bronze badges
2
- Are you creating an Office add-in or Office Script? – Rick Kirkham Commented yesterday
- an office script macro that i can use in a power automate flow – David Ricardo Menacho Vadillo Commented 22 hours ago
1 Answer
Reset to default 0Assuming this is Office Scripts and not an Office Add-in, you can return a 2D array from the script by adding the appropriate type to the signature. This script returns the data in the used range of Sheet1:
function main(workbook: ExcelScript.Workbook): (string | number | boolean)[][] {
let selectedSheet = workbook.getWorksheet("Sheet1");
let range = selectedSheet.getUsedRange();
let rangeData = range.getValues();
return rangeData;
}
You could also wrap the array in an object to make dealing with it in Power Automate easier. This sample shows how to merge worksheets and returns 2D arrays as part of that: https://learn.microsoft.com/office/dev/scripts/resources/samples/combine-worksheets-into-single-workbook
本文标签: Office Script return multidimensional arrayStack Overflow
版权声明:本文标题:Office Script return multidimensional array - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738189524a2067868.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论