I am facing the challenge of navigating through a JSON object where child objects contain IDs that need to be matched with parent properties. The JSON structure looks like this:
{
id: 1,
map: "test",
parameter_definitions: [{ID: 1, parameterUnits: "%"},{ID: 2, parameterUnits: "%"}],
},
{
id: 2,
map: "test2",
parameter_definitions: [{ID: 3, parameterUnits: "%"},{ID: 4, parameterUnits: "%"}],
}
My goal is to extract the 'map' value from the correct JSON object based on whether a given ID exists within the parameter_definitions array. This task seems challenging and I am struggling to find a solution.