Comma seperated list to an array in a JSON data structure

I have a webhook that receives data in a comma seperated list of values like this:

I want to put this data in a JSON data structure like this:

[
    {
        "command": "(...)",
        "args": {
            "type": "(...)",
            "field": "(...)",
            "entity": {
                "fibery/id": "(...)"
            },
            "items": [
                {
                    "fibery/id": " [array item 1] "
                },
                {
                    "fibery/id": " [array item 2] "
                },
                {
                    "fibery/id": " [array item 3] "
                }
            ]
        }
    }
]

I’ve created an array using split() and I’ve created the JSON data structure:

But all my attempts to put this data into the JSON items sub-array have failed.

I’ve found several topic on this forum that come close to what I need, but I can’t quite wrap my head around it and make it work. What would be the best way of doing this?

Full flow:

I got it working by using an Iterator that iterates over the array with an attached aggegrate to JSON.

3 Likes

Hello @tomvb :waving_hand:

Thank you for coming back and sharing the solution! I believe it will help other Makers with the same issue. :hugs:

2 Likes