Manipulating json array

good day

i have json array like below.

i need to split out and iterate over object “containers” (2 objects). somehow i cannot get this to work with Set node or with List node. I am trying this Set node, but then i get one output, but i need array of 2

[
  {
    "portOfLoading": {
      "code": "LVRIX",
      "name": "RIGA",
      "unLocode": "LVRIX"
    },
    "portOfLoadingCountryCode": "LV",
    "portOfDischarge": {
      "code": "DOCAU",
      "name": "CAUCEDO",
      "unLocode": "DOCAU"
    },
    "portOfDischargeCountryCode": "DO",
    "voyageReference": "084AQR",
    "nbUnits": 0,
    "routes": [
      {
        "journeyLegs": [],
        "containers": [
          {
            "id": "CMAU0907125",
            "movements": [
              {
                "statusOrder": "637949731",
              
              }
            ]
          },
          {
            "id": "DFSU1202801",
           
            "movements": [
              {
                "statusOrder": "637949731",
               
              }
            ]
          }
        ]
      }
    ]
  }
]

Hi @Edmunds_Priede

I am guessing you have a problem with the items node because routes is actually an array. There is 2 options. 1 to split the array of routes and then the array of containers. Or simply hardcode that you want the first object in the routes array.

1 Like