Question

How to create an attribute from a JSON response?

  • 29 January 2021
  • 2 replies
  • 86 views

rev1I'm reverse geocoding (XY coordinates to addresses) and I'm getting some business names back instead of the actual address. The data I need is in the full JSON response, but I don't know how to access this information.

 

 

After looking closer into the JSON results I found that the address I'm given is a short hand version of the data. I want the _arcgis_longlabel, instead of the _address field. How can I extract this specific attribute from the json response?

 

rev2 

 


2 replies

Badge +2

Hi @zemken12​ ,

Have a look at the JSONExtractor transformer. You can extract portions of JSON into attributes using this transformer. If you're new to working with JSON in FME, I'd highly recommend taking a look over the getting started with JSON in FME article as it will cover everything you'll need (and likely more).

Hi @zemken12​ ,

Have a look at the JSONExtractor transformer. You can extract portions of JSON into attributes using this transformer. If you're new to working with JSON in FME, I'd highly recommend taking a look over the getting started with JSON in FME article as it will cover everything you'll need (and likely more).

Chris - Thanks for the info. I was able to extract the specific fields from the JSON response by using the JSONFlattener. Under 'Attributes to Expose' I added the attributes of interest eg - '_latitude' or 'flat_address.City'. Hope this helps someone in the future. Thank you.

 

Reply