Question

How to extract a "grandchild" feature using the JSON Fragmenter?

  • 9 March 2021
  • 4 replies
  • 44 views

Hello, I am trying to extract a set of attributes that appear to be "grandchild" away from the parent feature. I am using the JSONFragmenter, and can extract from the parent using the JSON query: json["data"][*], but within this are four child attributes including "geometry", "properties" and "id".

 

I really want to split out a number of attributes within the "properties" section but don't know what I should put in the JSON query? Some of the desired attributes within properties are "laFeatureType", "reference" and "fieldName". But putting json["data"][*]["properties"]["reference"] in the query builder doesnt work.

 

Any help would be greatly appreciated 😀Screenshot 2021-03-09 at 09.49.53Screenshot 2021-03-09 at 09.49.04


4 replies

Userlevel 4
Badge +30

Hi @dangeerah​ 

Please, could you share the json file?

 

Thanks in Advance,

Danilo

Userlevel 6
Badge +32

A good trick to get the correct json query, is to save the response body to a file, temporarily change input source to file, select the saved file and use the tree to select the element you want, which gives the correct query. Then change back to attribute.

JsonQuerySelect

Hi @dangeerah​ 

Please, could you share the json file?

 

Thanks in Advance,

Danilo

Hello @danilo_fme​ ,

I have emailed you a single feature JSON file with the "properties" attribute.

Any help would be appreciated, Thanks 😁

A good trick to get the correct json query, is to save the response body to a file, temporarily change input source to file, select the saved file and use the tree to select the element you want, which gives the correct query. Then change back to attribute.

JsonQuerySelect

Thanks for this. I have tried this and put it in the data query, but would it be along one line like:

json["data"][*]

json["data"][*]["properties"]["area"]

json["data"][*]["properties"]["laFeatureType"]

 

Then attributes to expose:

properties

area

laFeatureType

 

But this does not return any values?

 

Thanks

 

 

Reply