Skip to main content

Hi - I'm trying to create individual records with attributes from a JSON response from an API. I've been able to call the API using the HTTP Caller and have tried using a JSON Fragmenter to extract attributes.

 

I don't seem able to get attributes from this but as shown in the attached there are a number of attributes in one of the returned rows. This looks as if it is a list called 'array' (there are 49 members in the 'list' which is as expected). I'd have thought I could use a List Exploder but this transformer doesn't pick up any list attributes.

 

I'd really appreciate any advice on how I might explode this structure in to individual rows with attributes.

 

Thanks and all the best.

 

Matt

 

HTTPcaller_JsonFragmenter

You need to explicitly expose the (list) attributes to be able to use them in subsequent transformers. You can do this directly in the JSONFragmenter (last parameter) or use an AttributeExposer transformer.

 

So something like

array{}.address{}

array{}.capacity

array{}.easting

 

etc.


You need to explicitly expose the (list) attributes to be able to use them in subsequent transformers. You can do this directly in the JSONFragmenter (last parameter) or use an AttributeExposer transformer.

 

So something like

array{}.address{}

array{}.capacity

array{}.easting

 

etc.

Thanks @jdh​ - really appreciate you helping out.

 

I think I'm getting somewhere now - I had to include another JSONFragmenter to create a record for each of the 50 features returned from the API call before being able to expose the attributes as you suggested.

 

I must be easily confused but every time I try to work with JSON it seems different!!!

 

All the best,

 

Matt

 

 


Thanks @jdh​ - really appreciate you helping out.

 

I think I'm getting somewhere now - I had to include another JSONFragmenter to create a record for each of the 50 features returned from the API call before being able to expose the attributes as you suggested.

 

I must be easily confused but every time I try to work with JSON it seems different!!!

 

All the best,

 

Matt

 

 

You should be able to do this with just one JSONFragmenter, could you post a snippet of the api response (obfuscated as necessary) and your transformer settings?


Reply