I have been trying to use Camunda 8 forms to accept list of inputs from user, like a user entering multiple IDs which can be assigned to a list variable and then that list can be passed as an input to execute a a DMN evaluating the list of inputs using feel expression.
But I am unable to use a list variable with Camunda 8 forms, please could you advise if this is possible and how this can be achieved.
Please share any examples/references if available.
The simplest workaround is to use string fields and allow the user to specify the values delimited. E.g. comma-separated IDs. Then you can either use that value directly in the dmn, e.g. to check if comma-separated list with optional white-spaces contains ID “123”: matches(input, "(^|,)\\s*123\\s*($|,)") or if you want to have the list you can transform the variable e.g. with a custom connector that just takes a variable name and delimiter and maybe some options like trim values or duplicate removal.
A nice solution would be to create a new form element that allows you to add multiple values. I don’t know enough about that, sorry.
Sometimes if only a few values are possible then you can just place some placeholders (e.g. ID1, ID2, ID3 if max 3 IDs). Another workaround.
thanks cma,
Using a list variable is a very basic functionality, do we really need to create a connector to use list variable ? is there no support for list/array variables in Camunda modeler itself ?
thanks for that, in 8.3 is there a way to show list/array content on the form ? I have tried mapping it to text area but it doesn’t show up as it seems text area just renders a string field and not an array/list. any other form component that can help me render a list on UI in 8.3 ?
The component also supports some limited use of HTML tags.
More on text templating here:
In 8.5 we are introducing an HTML component which will allow a lot more flexibility in rendering.
Using a list variable is a very basic functionality
There’s probably a place for a string list component similar to the tag-list in the form editor. Something a bit more lightweight than the dynamic list. But for now it’s not available.
Hope that answers things for you.
Let us know if you’ve got other questions.