Reputation: 895
I want to pick the first value of 'Code' element from following Json Payload. I am using following website to try this out. http://jsonpath.curiousconcept.com/
Json Payload:
{
"TotalAccounts": {
"Account": [
{
"Code": 123,
"Account": {
"Name": {
"Initials": null
},
"Address": {
"Street": "ABC"
}
},
"ContactInformation": {
"Email": "[email protected]"
},
"DunningLevelCode": "R0"
},
{
"Code": 456,
"Account": {
"Name": {
"Initials": null
},
"Address": {},
"CustomFields": null
},
"ContactInformation": {
"Email": "ABC@@gmail.com",
"Phone": null,
"Mobile": null,
"Fax": null
},
"DunningLevelCode": "abc"
}
]
}
}
The Json path i am using is below:
$..Code
Result:
[123,456]
Expected Result:
[123]
Need help.
Upvotes: 0
Views: 42