Here is the JSON file I am working with:
{
"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 attempting to access the $requestedAmount value. This is the code snippet I have written so far:
In order to search for the existence of "data" in the JSON, I tried using a loop. Here's how my code looks like:
var order = obj.clbcks;
for ( i in order )
{
if ( order[i].hasOwnProperty( 'data' ) )
{
//do something
}
}
However, I am encountering an error while running this code. Any assistance would be greatly appreciated. Thank you.