I have the JSON file:
{
"src": "Dvc",
"rte": {
"src": "dvc"
},
"msgTyp": "dvc.act",
"srcTyp": "dvc.act",
"cntxt": "",
"obj": {
"clbcks": [
{
"type": "",
"title": "",
"fields": [
{
"src": "label.PNG",
"id": "Label",
},
{
"id": "MSG",
"text": "APPROVED",
"type": "label"
},
{
"id": "amt",
"text": {
"text": "{0:currency}",
"substitute": {
"data": [
"$requestedAmount"
]
}
},
"type": "lbl"
},
],
}
]
I am trying to reach the $requestedAmount. This is my code:
I tried looping through the JSON file to check if the "data" existed.This is the code that I am using:
var order = obj.clbcks;
for ( i in order )
{
if ( order[i].hasOwnProperty( 'data' ) )
{
//do something
}
}
It's throwing an error. Can someone please help. Thanks.