List to dictionary, first sublist[0] as key

I have list with headers, elements and values, as follows:

some example data(you can paste it in code block as example):

["Element Name","Element GUID","header_propertie 1","header_propertie 2","header_propertie 1","header_propertie 3","header_propertie 3","header_propertie 4","header_propertie 4"]; ["Some Item 1","83b10100-2404-4e99-8d6f-3388b61f0940","Value 1.0","Value 2.0","Value 1.1","Value 3.0","Value 3.1","Value 4.0","Value 4.1"]; ["Some Item 2","5f5dd4c3-cf63-4259-aba3-1676ed818a2f","Value 1.1","Value 2.1","Value 1.2","Value 3.2","Value 3.3","Value 4.2","Value 4.3"];

Within the data there are double headers, eventually they must be merged and set as key.
So is started with some list logic but couldnt figure it out. Did try ‘GroupByKey’ Node .

eventualy i want the following output within a JSON file

{
    "objects": [
        {
            "Element Name": "Some Item 1",
            "Element GUID": "83b10100-2404-4e99-8d6f-3388b61f0940",
            "header_propertie 1": [
                "Value 1.0",
                "Value 1.1"
            ],
            "header_propertie 2": "Value 2.0",
            "header_propertie 3": [
                "Value 3.0",
                "Value 3.1"
            ],
            "header_propertie 4": [
                "Value 4.0",
                "Value 4.1"
            ]
        },
        {
            "Element Name": "Some Item 1",
            "Element GUID": "5f5dd4c3-cf63-4259-aba3-1676ed818a2f",
            "header_propertie 1": [
                "Value 1.1",
                "Value 1.2"
            ],
            "header_propertie 2": "Value 2.1",
            "header_propertie 3": [
                "Value 3.2",
                "Value 3.3"
            ],
            "header_propertie 4": [
                "Value 4.2",
                "Value 4.3"
            ]
        }
    ]
}

hi @nwbos

something like this: to_json.dyn (13.0 KB)

-biboy

2 Likes

thanks!
Your input is exactly what I needed.