You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

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": [
{
"attributes": {
"OBJECTID": 100,
},
"geometry": {
"x": -27.99,
"y": 67.33
}
}
]
}
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
Offline

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.
Offline

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
Last edited by talendtester (2012-07-02 18:51:55)
Offline

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