I'm struggling to convert an array that I've been given into a useful format:
Given
{
"myValues": [{
"0": {
"id": "5ed32599-3c4d-49ad-8a1a-79bbc39a3e02",
"value": "my Value",
"value2": "my Value 2"
},
"1": {
"id": "5ed32599-3c4d-49ad-8a1a-79bbc39a3e02",
"value": "my Value",
"value2": "my Value 2"
},
"id": "5ed32599-3c4d-49ad-8a1a-79bbc39a3e02"
}]
}
I am trying to remove the numbers in front of the objects and just the ID that sits outside of the two inner objects.
Therefore I would then be given:
{
"myValues": [{
"id": "5ed32599-3c4d-49ad-8a1a-79bbc39a3e02",
"value": "my Value",
"value2": "my Value 2"
},
{
"id": "5ed32599-3c4d-49ad-8a1a-79bbc39a3e02",
"value": "my Value",
"value2": "my Value 2"
}
]
}
I have been trying to use different ways of mapping Objects into new formats but I'm really struggling particularly to get rid of the IDs