U

9 Messages

 • 

1.7K Points

Thursday, September 12th, 2024 3:49 AM

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

62 Messages

 • 

755 Points

3 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.

9 Messages

 • 

1.7K Points

George, thankyou for responding.  I have been able to get this going.  Its a read game changer.  Extending on this use case, should I be able to do it in Sub Form also.  ie. Using subforms to select specific columns and actions based on the original maps created.  I'm keen to do this on the same form as I want full transparency of the fields that have been selected and actions indicated on those columns.  I would have thought that any subform should have full access to global values set by execution.setVariable() functions.

Loading...