tFileInputJSON - How do I get the data out of the second level?

Nine Stars

tFileInputJSON - How do I get the data out of the second level?

I am able to pull the data for the field OBJECTID by doing "$..OBJECTID" in the JSONPath query in my tFileInputJSON component.
I need help getting the data for the x and y fields. What should the JSONPath query be to get the x and y data?
Here is what my small test file looks like:
{
"displayFieldName": "FM_NAME",
"fieldAliases": {
"OBJECTID": "OBJECTID",
},
"geometryType": "esriGeometryPoint",
"spatialReference": {"wkid": 1000},
"features":
}

The job runs and gives an error message of:
Can't find any data with JSONPath $...X
Can't find any data with JSONPath $...Y

I found this post, it looks like it hasn't been resolved, so that is why it is not working for me?
http://jira.talendforge.org/browse/TDI-17306
One Star

Re: tFileInputJSON - How do I get the data out of the second level?

Hi
Try these two JSONPath.
"$.features..x"
"$.features..y"
Regards,
Pedro
Nine Stars

Re: tFileInputJSON - How do I get the data out of the second level?

Thanks Pedro!
It gives me the right output now.
Do you know why it gives me these messages?
The Json resource datas maybe have some problems, please make sure the data structure with the same fields.
The Json resource datas maybe have some problems, please make sure the data structure with the same fields.
One Star

Re: tFileInputJSON - How do I get the data out of the second level?

Hi
Please show me the settings of tFileInputJSON. I didn't get this info.
Regards,
Pedro
Nine Stars

Re: tFileInputJSON - How do I get the data out of the second level?

Property Type: Built-In
Schema: Built-In
Filename: C:/folderName/fileName.txt
Column JSONPath query
----------------------------------------------
OBJECTID "$..OBJECTID"
X "$.features..x"
Y "$.features..y"

Nothing is in the Advanced Settings section.

The schema is:
OBJECTID String 3
X String 20
Y String 19
One Star

Re: tFileInputJSON - How do I get the data out of the second level?

Hi
This is because in your json file there are two OBJECTIDs.
"OBJECTID": "OBJECTID"
"OBJECTID": 100
Use this jsonpath: "$.features..OBJECTID".
Regards,
Pedro