Forum Discussion

nkpalli's avatar
nkpalli
Contributor
7 years ago

Nested Loop : How to iterate and compare to Db output results

Need some sample code to loop through a nested array and compare each key value to DB column value:

Here below is sample JSON response object :

 

{

"status": 200,
"data": [
{
"key1": "1255",
"key2": 1X1,
"key3": [
{
"key3/sub-key1": 1725,
"key3/sub-key2": null,
"key3/sub-key3": 1,
},
{
"key3/sub-key4": 1470,
"key3/sub-key5": null,
"key3/sub-key6": 2,
},
{
"key3/sub-key7": 1435,
"key3/sub-key8": null,
"key3/sub-key9": 3,
},

],
"Key4": "2018/01/18",
"Key5": "176",
},

{
"key1": "1255",
"key2": true,
"key3": [
{
"key3/sub-key1": 1735,
"key3/sub-key2": null,
"key3/sub-key3": 1,
},
{
"key3/sub-key4": 1480,
"key3/sub-key5": null,
"key3/sub-key6": 2,
},
{
"key3/sub-key7": 1445,
"key3/sub-key8": null,

"key3/sub-key9": 3,
},
],
"Key4": "2018/02/18",
"Key5": "350"
}

]
}

 

I have attached DB.XLSX which has sample of table contents .

UniqueID: Key5/(key3/sub-key3)

No RepliesBe the first to reply