camundacamunda-modeler

Cannot render array type variables in Camunda 8 forms


I am using the Hugging Face Inference API connector and the result expression is defined like this:

{
  mapped_result: response.body.translation_text
}

So I have a process-wide variable called mapped_result. Then I have a user task and I have defined an input for it. Its local name is returned_value and it points to mapped_result. But when I set the key of a text field component in form to returned_value, it is shown empty in the Tasklist.

In Operate, I can see that returned_value is constructed like this:

|    Key   |           Value            |
| -------- | -------------------------  |
| returned_value | ["Er ist der Mann."] |

So the value is an array. But I can’t render it in the form. And when I use indices, it won’t work. I have already used this:

{
  mapped_result: response.body.translation_text[0]
}

It doesn’t work. Any ideas?


Solution

  • I got this. The problem was that I was assuming the indices begin with 0 in FEEL expressions. They start with 1. So I changed my configuration to this:

    {
      mapped_result: response.body.translation_text[1]
    }
    

    and it worked.