Forum Discussion

Goudriaan's avatar
Goudriaan
Copper Contributor
May 30, 2023
Solved

EXCEL ONLINE script filter pivottable with Power Automate data

Hi all,    I have a script where I have a pivot table (PivotTable1) on worksheet Transportkosten_klant. I want to use the customer specific name using a Power Automate flow which runs every quarter...
  • SergeiBaklan's avatar
    May 30, 2023

    Goudriaan 

    Perhaps like

    function main(workbook: ExcelScript.Workbook) {
    
    	const filterField =
    		workbook
    		.getWorksheet("Sheet1")
    		.getPivotTable("ptSample")
    		.getHierarchy("Category")
    		.getPivotField("Category")
    
    	const filter: ExcelScript.PivotLabelFilter = {
    		condition: ExcelScript.LabelFilterCondition.contains,
    		substring: "Microsoft",
    		exclusive: false
    	};
    
    	filterField.applyFilter({ labelFilter: filter });
    
    }

    Just an idea, but works on attached file

Resources