UI Builder - List Filtering via Client State Parameter

IosifH
Tera Contributor

Hi everyone,

 

I’m working on a UI Builder page where I have three Single Score widgets displaying counts from a table. The intended behavior is that clicking on any of these widgets should update a List below to show relevant filtered cases (assigned to me, unassigned or not updated recently).

 

Here’s what I’ve set up so far:

* A client state parameter named selectedFilter of type String.
* Each widget updates this parameter on click using the "Update client state parameter" action, with raw string values like assigned_to_me.
* The List component is bound to a List Data Resource, and that data resource includes a scripted filter (under default display) function using selectedFilter.

 

function evaluateProperty({ api, helpers, selectedFilter }) {
  console.log("Selected Filter:", selectedFilter); // Debugging

  switch (selectedFilter) {
    case "assigned_to_me":
      return [
        {
          field: "assigned_to",
          operator: "equals",
          value: api.getCurrentUserId()
        }
      ];

    case "unassigned":
      return [
        {
          field: "assigned_to",
          operator: "ISEMPTY"
        }
      ];

    case "no_update":
      return [
        {
          field: "sys_updated_on",
          operator: "RELATIVELE",
          value: "10 days ago"
        }
      ];

    default:
      return [];
  }
}

 

I've ensured:

* The selectedFilter is listed as a parameter in the function configuration
* The List component is bound to the data resource
* The parameter updates correctly (verified with a Text widget)
* No quotes are passed in the parameter value

 

Issue:
Despite all of the above, the List doesn’t update, and the filter doesn’t seem to apply. Has anyone experienced this? Is there something else that needs to be wired or refreshed for reactive filters in UI Builder data resources to work consistently?

 

Any help would be greatly appreciated!

Thanks in advance!

0 REPLIES 0