8 Messages
•
1.5K Points
Workflow: User From functionality (dynamic forms) - Filtering selections in form from a previous selection
USE CASE: Enabling filtering of selectable values in a single selection field based on the selection of a single selection field (above in the same form).
I am keen to explore (within 1 form) selecting from a list of values, where the selection from that list, then enables a filtered list in the next list of values. ie. From a Physical Data Dictionary, we select a table, and in the next field, only columns within that table are shown for selection. We can do this easily across multiple screens, but I would like to do it dynamically in a single form. I have explored with sub forms, and tried to search for flowable examples where this approach exists, but have failed to find appropriate content. Using multiple forms, the filtering would be done via java API scripts into map lists for a single select.
Accepted Solution
georgecheung
62 Messages
•
755 Points
2 months ago
The form will need to be in a user task, and not the start event.
The reason for why it has to be in a user task is because there needs to be a script task that runs and gathers the possible values.
In the example, when a table is selected, the next field should populate with the columns of the selected table.
The script task would need to gather the values and store them in a map, the key of the map is the table id, and the value of the map are the list of proposed values (columns related to table).
The form is configured such that the proposed values for the column field uses the table as the key such as {{columnMap[tableId]}} where tableId is the variable that stores the selected table, and columnMap is the map created by the script task.
Be careful when using this approach as it may not scale well if there are millions of tables.
Hope this helps.
1