Fix ExcelScript PivotField Manual Filter Not Working in Office Scripts
Question details
Users report that ExcelScript.PivotField.applyFilter fails to apply manual filters in Office Scripts, despite running without errors and label filters working correctly.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Automating PivotTable filtering using Office Scripts in Excel.
- Observed behavior
- The script runs without throwing errors, but manual filters remain inactive and the getFilters method returns null. This is suspected to be a regression from a recent update.
Verify your current Excel build number and check if the issue persists across different workbooks or only occurs in specific files.
Diagnose Workbook-Specific Issues and Report the Regression
Since this is likely a service-side regression or update bug, isolate the issue and escalate it to Microsoft Support.
Recent Excel updates have caused regressions where manual filters fail in Office Scripts while label filters continue to work. Isolating the issue helps confirm if the bug is service-wide or tied to a specific file.
Create a new, blank workbook and insert a simple Pivot Table to test your Office Script.
Run a test script using ExcelScript.PivotField.applyFilter with a previously retrieved manual filter.
Compare the results across different Excel versions or update channels if you have access to multiple devices.
Document your script, the workbook structure, your Excel build number (found in File > Account), and reproduction steps.
Submit this documentation through Microsoft Support or the Office Scripts feedback channel via Help > Feedback.
Use Label Filters as a Temporary Workaround
If manual filters are broken but label filters work, rewrite your script to use label filters temporarily.
Try WPS Office for Reliable Spreadsheet Management
Dealing with unexpected update regressions in Microsoft Office can disrupt your workflow. WPS Office offers a free, lightweight, and highly compatible alternative for advanced spreadsheet data analysis, Pivot Tables, and macros.

Frequently Asked Questions
Why does getFilters return null even when an Office Script runs without errors?
This typically happens due to an API regression in a recent Excel update where the Office Scripts engine fails to register or apply the manual filter criteria to the Pivot Table, resulting in a null return value.
Can I fix the manual filter issue by modifying my script code?
If the issue stems from an Excel update regression, modifying the manual filter syntax won't fix it. However, you can temporarily modify the script to use label filters, which are often unaffected by this specific bug.
How do I check my Excel build number for reporting the issue?
Open Excel, click on 'File', then select 'Account'. Under the 'About Excel' section, you will find your version and build number, along with the update channel (e.g., Current Channel, Semi-Annual Enterprise Channel).
Are JS Macros in WPS Office a substitute for Office Scripts?
Yes, WPS Office supports JS Macros which use JavaScript to automate tasks similar to Office Scripts. While the exact API structure differs, you can achieve similar automation for Pivot Tables and spreadsheet data processing.




