Google Sheets API PivotFilter.getFilterCriteria yields "Service error: Spreadsheets" when the filter contains a formula
14:19 14 Mar 2026

PivotFilter.getFilterCriteria returns the expected result when the filter references values directly as in: 'Text contains A'. However, when the filter references formulas as in: 'Text contains ="A"', I get the above error. Both filter criteria work as expected within the pivot table itself. It's just the API that appears to have a problem with the 2nd one.

Eventually I'd like to get to handling dynamic filter criteria through the API by using more complicated formulas, but I'm not even getting past the trivial case above.

Any ideas? Thanks in advance!

google-sheets google-apps-script