I have to get the values of the following response.
var response = { "data": [
{
"value": "Network problem",
"text": "Network problem",
"areas": [
{
"value": "Congestion",
"text": "Congestion",
"sub_areas": [
{
"value": "Congestion_1",
"text": "Congestion_1",
"id":"1"
},
{
"value": "Call D",
"text": "Call D",
"id":"2"
}]
},
{
"value": "Drop",
"text": "Drop",
"sub_areas": [
{
"value": "Drop_1",
"text": "Drop_1",
"id":"3"
}]
}
]};
If I have the value "Network problem"
, then I have to retrieve its areas(ex: areas = ["Congestion","Drop"])
. Then I have to rerieve the sub areas using area value. If area value is "congestion"
, then sub_areas =["congestion_1", "Call D"]
). How can I do it