How to Implement Dependent Dropdowns with Distinct Values from a Non-Persistable Entity in a DataGrid?

0
Hello, I'm working on a use case where I have a non-persistable entity called WorkerDetails. A microflow fetches a list of WorkerDetails using Execute Parameterized Query, and this list is displayed in a DataGrid with the microflow as its data source. I want to add New and Edit buttons to this DataGrid, and in the corresponding forms, I need to implement dependent dropdowns for attributes of WorkerDetails (e.g., Department, Role, Location). Each dropdown should only show distinct values of its respective attribute from the list returned by the microflow. Challenges: Since WorkerDetails is non-persistable, I can't use XPath to directly fetch distinct values. The dropdowns need to be dependent, i.e., selecting a Department should filter the available Roles and so on. The list of  WorkerDetails is user-specific, which is why I chose a non-persistable entity to avoid persisting data unnecessarily. Question: Is there a recommended way to implement this kind of dependent dropdown logic using non-persistable entities? Or is there an alternative approach that supports user-specific data while still allowing distinct value filtering and dropdown dependencies?   Thanks in advance!
asked
1 answers
0

Option 1: Use Helper (Persistable) Entities for Distinct Values

  1. Keep your WorkerDetails as NPE for display.

  2. When your microflow fetches the WorkerDetails list:

    • Extract distinct Departments, Roles, Locations into small persistable helper entities (e.g., DepartmentFilter, RoleFilter, LocationFilter).

    • Associate them to the current user session (or a transient object).

  3. Bind your dropdowns to these helper entities with XPath or associations.

  4. Implement dependency:

    • On selecting Department → refresh Roles list (via microflow that filters roles where WorkerDetails.Department = selected).

    • Same for Location.

 

Option 2: Stay Pure NPE (All Microflow-Sourced Dropdowns)

  1. Add NPEs: DepartmentOption, RoleOption, LocationOption.

  2. When fetching WorkerDetails, also fill these NPEs with distinct values (by Java/SQL or looping in a microflow).

  3. Set dropdowns to use microflow data source returning distinct values.

  4. On change of Department, trigger an on change microflow to refresh Role options.

 

Option 3: Hybrid — Persist WorkerDetails in a Temp Table

  • If your dataset isn’t huge:

    • Store WorkerDetails in a persistable temp table with a session key (user-specific).

    • Then dependent dropdowns are trivial (just XPath with distinct or constrained associations).

  • Add a cleanup step to delete data after session timeout/log-out.

answered