Skip to main content
Question

How to create an attribute from a JSON response?

  • January 29, 2021
  • 2 replies
  • 510 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

chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • January 29, 2021

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


  • Author
  • February 25, 2021
chrisatsafe wrote:

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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings