Node for array into dictionary

Hi there,
I have quite a common use case that right now I am implementing via a node function.
The typical use case is an array of dicts with a set of properties.
All I do is to transform into a dict by selecting a key and a value from the dicts of arrays.

Example below:

{
    "signals": [
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "E",
            "physicalQuantity": "E",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "-",
            "value": "0.00"
        },
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "Flow_Volume",
            "physicalQuantity": "Volume",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "m^3",
            "value": "2.92"
        },
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "Delta_T",
            "physicalQuantity": "Temperature difference",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "K",
            "value": "0.09"
        },
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "Return_T",
            "physicalQuantity": "Return temperature",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "°C",
            "value": "23.53"
        },
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "Flow_T",
            "physicalQuantity": "Flow temperature",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "°C",
            "value": "23.63"
        },
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "Flow_Speed",
            "physicalQuantity": "m/s",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "-",
            "value": "0.00"
        },
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "Energy",
            "physicalQuantity": "Energy",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "Wh",
            "value": "9900.82"
        },
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "Power",
            "physicalQuantity": "Power",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "W",
            "value": "0.00"
        },
        {
            "device": "65535",
            "functionMedium": "Instantaneous value",
            "name": "Return_Volume",
            "physicalQuantity": "Volume",
            "storage": "0",
            "tariff": "4294967295",
            "unit": "m^3",
            "value": "0.00"
        }
    ]
}

This will become:

{ "Return_Volume": 0.0,"Power": 0.00, ... }

Hey @Paolo_Proxy,

I’m having trouble understanding how your example input transforms into your example output. It doesn’t appear as though the keys in the output come from the input - or I’m misinterpreting. Can you explain in more detail please?

Yes so if you see the first array of dictionaries, take the last entries, it contains name = Return Volume and value = 0.0, it then gets converted into {“Return Volume”: 0.0}.

Ok, I see now. I suppose that’d be some addition to the Array Node. I’m not sure what the operation would be called. Kind of “remapping” an object to another object.

Yes that is a good idea, I like the naming. :grinning: