I have a JSON with nested fields:
[
{
"Platform Parent Dato Id": "23768",
"Platform Dato Id": "24138",
"Platform Dato Name": "Random Europe",
"Platform mission Id": "111112",
"Platform submission Id": "638687",
"Platform submission Flight Id": "863524",
"Start Date": "2017-12-01",
"End Date": "2017-12-02",
"Platform Compensation": 109.0909,
"Total Value": 909.0909,
"Goal": "200000.0000",
"Value Information": {
"Platform Compensation": [
{
"Platform mission Id": "111112",
"Platform submission Id": "638687",
"Platform submission Flight Id": "863524",
"Value Rate": "14.0000",
"Value": 109.0909
}
]
}
},
{
"Platform Parent Dato Id": "23768",
"Platform Dato Id": "24138",
"Platform Dato Name": "Random Europe",
"Platform mission Id": "111113",
"Platform submission Id": "638687",
"Platform submission Flight Id": "863524",
"Start Date": "2017-12-01",
"End Date": "2017-12-02",
"Platform Compensation": 109.0909,
"Total Value": 909.0909,
"Goal": "200000.0000",
"Value Information": {
"Platform Compensation": [
{
"Platform mission Id": "111113",
"Platform submission Id": "638687",
"Platform submission Flight Id": "863524",
"Value Rate": "12.0000",
"Value": 109.0909
}
]
}
}
]
and I am using a JSONPATH in order to get the Value Rate
from the Value Information
nest.
I have pasted my JSON text in this website: http://jsonpath.com/ and after using this line:
$[*].['Platform Compensation'].['Value Rate']
I am getting this:
and after using this line:
$.['Value Information'].['Platform Compensation'].['Platform mission Id']
I am getting this:
What I am trying to return (output) is the following:
but I cannot find the right syntax to combine those two in one line and return both with one JSONPATH query.
Jayway implementation let you do that.
The jsonpath would be
$.[*]['Value Information']['Platform Compensation'][*]['Platform mission Id', 'Value Rate']
You can try it in this website http://jsonpath.herokuapp.com/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With