Optimized table column filter doesn't show list of values when using .pyTextValue

Hi,

We are encountering an issue when applying a filter to a column in an optimized table. The list of values for the field does not appear in the filter pop-up (screenshot attached). We are using .pyTextValue() as the column value since a function is applied to the column in the Report Definition (RD). This issue only occurs for one specific column, while filters for other columns using .pyTextValue work correctly (UPDATE: It only works for .pyTextValue(1), other indexes are getting the same error).

The following error was captured in the tracer:

Section ‘pzGetGridColUniqueValues’ execution error on page ‘’ of class ‘Embed-FilterColumn’:
The reference .pyTextValue(2) is not valid. Accessing invalid index 2 whereas the list has 0 elements from Requestor: null.

Has anyone encountered a similar issue or have any insights into a possible solution?

Thank you.

@IchsanM16625601

Please see the suggestion given on our MSP GenAI Buddy:

:warning: This is a GenAI-powered tool. All generated answers require validation against the provided references.

Based on the error you shared (“The reference .pyTextValue(2) is not valid. Accessing invalid index 2 whereas the list has 0 elements from Requestor: null”), there appears to be two interrelated issues occurring:

  1. Filter Logic Behavior: There is a known issue in Pega where the filter logic does not consider the filter by value setting and instead uses the pyUILabel property by default for showing unique values in the filter pop-up. This can cause problems when using functions like .pyTextValue() in column definitions.
  2. Index Access Issue: The error specifically indicates that when the system tries to access index 2 of the pyTextValue list, it finds that the list has 0 elements. This explains why .pyTextValue(1) works while other indexes fail. It seems the filter functionality attempts to access the list values differently than the regular column display.

The section ‘pzGetGridColUniqueValues’ that’s generating the error is responsible for populating the filter dropdown with unique values from the column. When it encounters .pyTextValue() with indexes other than (1), it appears to be unable to process the values correctly.

Possible solutions:

  1. Column Configuration Workaround: Since you’ve noticed that .pyTextValue(1) works correctly, consider restructuring your Report Definition to use this index instead of higher indexes when possible.
  2. Alternative Property Access: Instead of using .pyTextValue(2) directly in the column, you could create a calculated property in your data model that extracts and formats the desired value, then reference this property in your column definition.
  3. Custom Filter Implementation: For critical columns where filtering is essential, you might need to implement a custom filter solution using JavaScript and the grid’s API if the built-in filtering cannot be fixed.

References: