Xpath - Extract element based on other element in the JSON response
I have a JSON response with following structure which is dynamic. I want to extract the account balance to a data bank of specific person eg:John
"Details" : [
{
"AccountBalance" : "6793",
"Person" : "John"
},
{
"AccountBalance" : "3646",
"Person" : "Peter"
0
Comments
Try an XPath like the following in your JSON Data Bank: /root/Details/item[Person/text() = 'John']/AccountBalance/text()
That worked. Thanks a lot!