Pivot Filter Criteria not Properly Applied

2019-02-20 17:37发布

问题:

I've been working with the Google Sheets API within Google Apps Script. I closely followed their provided example, but saw that in their example, the pivot table object lacks the criteria field (which specifies filters).

To account for a filter, I added:

"criteria": {
   0: {"visibleValues": ["exampleString"]} 
}

and when running the code, the Report Editor shows there is indeed a filter with one item.

However, the filter is not actually being applied to the pivot table, and is only activated when I click into the Report Editor's filter box and select "OK". This seems like an error, as the filter is not being applied in the sheet, despite being specified programmatically and recognized by the sheet.

Am I missing something here?