How can I group outputs from DMN by input variable name?

I have DMN table that stores some data and I have a parallel multi-instance task that sends unique values (as objects) to the DMN table and in the end return the result as a list of object. I would like to get the results grouped such that each key is the input variable and the value is the list of matched results.

This is what I have now.

[{"timeframe":"one_month","title":"One month"},{"timeframe":"one_week","title":"One Week"}]

This is what I would like to get.

{"foo": [{"timeframe":"one_month","title":"One month"},{"timeframe":"one_week","title":"One Week"}], "faa": [{"timeframe":"one_month","title":"One month"},{"timeframe":"one_week","title":"One Week"}]

My Multi-instance DMN task

Thank you