Using Tasklist API to write user task variables

Hi! I’m looking to use the Tasklist API to send variables to a user task. I’d like to send variables that have a JSON/Map/dictionary structure like you can build within BPMN/FEEL so I can access keys in the structure via FEEL. For example, sending a variable as:
{name: “VarA”, value: {“a”: 1, “b”: 2, “c”: 3}}.

The only way to write it as far as I can tell is to make the value in this all a string which means I can’t access the keys a, b, c via FEEL. I also tried doing something like:
{name: “VarA.a”, value: 1}
{name: “VarA.b”, value: 2}
{name: “VarA.c”, value: 3}
but this didn’t build JSONs of the variables either, just created variables literally as VarA.a, VarA.b, VarA.c and not together as a JSON.
Should I be using the Zeebe API instead? Anyone figure out how to do this? Ultimately I’m trying to create a list of JSONs in an output variable/global process variable for the task.

Hello @pvnordic, welcome to the community

you need to stringify your json value like this:

{"name": "VarA", "value": "{\"a\": 1, \"b\": 2, \"c\": 3}"}

I hope this can help.

Best regards,

1 Like