'How to find out the current group level of a range in excel for web using office-script

I am trying to find out how to identify the current group level of a range in office-script. Based on the documentation I was only able to find the group or ungroup methods.

https://docs.microsoft.com/en-us/javascript/api/excel/excel.range?view=excel-js-preview#excel-excel-range-group-member(1) However, if my row is already grouped I will create a sub-group with these methods. The only workaround I can think of is to ungroup multiple times and the to group to my desired level.

In vba you were able to read/write to the OutlineLevel property

https://docs.microsoft.com/de-de/office/vba/api/excel.range.outlinelevel

Any help is appreciated.



Solution 1:[1]

These APIs are not supported in Excel JS add-ins at this moment. You can suggest this at Microsoft 365 Developer Platform Ideas

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Wenjun Gong