I'm wondering if this is possible, as with pivot tables in excel there is an option to expand or collapse all fields. If you try to record this in Automate, it says this action cannot be recorded. A work around I'm currently using is this code:
// Collapse pivot item "APAC" in pivot "Region"
newPivotTable.getHierarchy("Region")
.getFields()[0]
.getPivotItem("APAC")
.setIsExpanded(false);
However it requires you to name each pivot item in order to collapse them. I'm looking for a way for it to collapse all pivot items dynamically without having to hard code them.
