I have this data saved in an attribute lets say "Data" .I have to Match this "Your_Name" present in this Data with some Field(mentioned below) which will be called after API.
[
{
"admin": "A1",
"Your_Name": "Lily",
"Reason1": "Shot"
}
]
Now, This is the data which will get after API call in InvokeHttp processor, I have stored it in an "ResponseData" attribute using ExtractText.
I have to match Data's "Your_Name" with ResponseData's "Name", if both of these matches we will send the respectives "nameId" in some outputstream variable or something so that it can go ahead as an output(the nameId only of the Name which matched with Your_Name).
[ {
"Name" : "Ivor",
"Speciality" : [ {
"nameId" : "611",
"SId" : "2"
} ]
}, {
"Name" : "Philip",
"Speciality" : [ {
"nameId" : "980",
"SId" : "12"
} ]
}, {
"Name" : "Adams",
"Speciality" : [ {
"nameId" : "611",
"SId" : "2"
} ]
},
{
"Name" : "Lily",
"Speciality" : [ {
"nameId" : "618",
"SId" : "20"
} ]
}
]
Two of the Name (here Ivor and Adams) can have the same nameID, So we have to match Name and send its nameId only. I want to write ECMA script for this.