Search and Select Pattern: A picklist filter for a data reference. Pass case properties as parameters to the picklist's source data page

Hello all,

Pega Platform: Infinity 25

Use case: Advanced search and select has 2 filter properties, one of them is a dropdown. CustomerGroup field’s dropdown values are fetched from API via datapage by passing GroupID (in pyworkpage) as parameter to API data page.

  • CustomerGroup : Dropdown field, sourced from datapage with API, class context Org-App-Data-Customer
  • GroupID: In pyworkpage, class context Org-App
  • Customer List: Single record data reference field, in which CustomerGroup is a filter in Search&Select, class context: Org-App-Data-Customer

Problem Statement: GroupID property has a value in work- context cannot be passed to API data page in traditional manner. Because this property /context doesn’t exist when filter property’s API data page runs as a resource.

Available Solution:

  1. Specialize pyRefreshData data transform in Org-App-Data-Customer.
  2. Property Set .GroupID == Top.content.GroupID
  3. Add GroupID as a separate filter under CustomerGroup.
  4. Set Default inputto filter’s GroupID as .GroupID
  5. In CustomerGroup property pass .GroupID as a parameter to datapage source.

Explanation:

  • Top.content is API context page where request data for case’s DXAPI is set and pyRefreshData is run. We can find case data in content page.
  • Even though we set GroupID property in pyRefreshData, data is still not in filter’s context. To achieve this, we added GroupID as a separate filter and hidden if necessary.
  • Now, we have GroupID in filter’s context. But, we need value in it. So, set default input as property reference and refer .GroupID (which will be in Data-Customer context)
  • Now, value is present in filter’s context. By referring, .GroupID in CustomerGroup’s source datapage’s paramter, value is passed successfully.

Drawbacks:

  • pyRefreshData runs on every load/refresh of that context. So, property is set every time it loads.
  • Hiding a filter property always is not possible. “Never” isn’t available in visibility condition. So, logic for this visibility must be built carefully.
  • In this usecase, GroupID is in parent class of both data and work. If parameter filed is not in the same inheritance, then please try using a different field in pyrefreshdata.
  • Please add it to Constellation101 if possible.