I need assistance in extracting the state parameter values for each id - 2434,78657 using typescript. Due to the nested JSON structure, I am encountering difficulties in fetching these values.
JSON Request:
{
"2434":[
{
"eventId":"90989",
"eventTime":"2019-12-11T11:20:53+04:00",
"eventType":"yyyy",
"event":{
"ServiceOrder":{
"priority":"1",
"state":"InProgress"}
}
},
{
"eventId":"6576",
"eventTime":"2019-12-11T11:20:53+04:00",
"eventType":"yyyy",
"event":{
"ServiceOrder":{
"priority":"1",
"state":"InProgress"
}
}
},
{
"eventId":"6576",
"eventTime":"2019-12-11T11:20:53+04:00",
"eventType":"yyyy",
"event":{
"ServiceOrder":{
"priority":"1",
"state":"Pending"
}
}
}
],
"78657":[
{
"eventId":"6576",
"eventTime":"2019-12-11T11:20:53+04:00",
"eventType":"yyyy",
"event":{
"ServiceOrder":{
"priority":"1",
"state":"Pending"
}
}
},
{
"eventId":"6576",
"eventTime":"2019-12-11T11:20:53+04:00",
"eventType":"yyyy",
"event":{
"ServiceOrder":{
"priority":"1",
"state":"Completed"
}
}
},
{
"eventId":"6576",
"eventTime":"2019-12-11T11:20:53+04:00",
"eventType":"yyyy",
"event":{
"ServiceOrder":{
"priority":"1",
"state":"Failed"
}
}
}
]
}
Desired Output:
To illustrate, an array containing all state parameter values should be returned for id 2434.
[InProgress, InProgress, Pending]