When working with JSON, I have had a lot of success using the Hub transformer ListKeyValuePairExtractor.
That transformer takes a list and converts it to attributes.
Hope this helps.
When working with JSON, I have had a lot of success using the Hub transformer ListKeyValuePairExtractor.
That transformer takes a list and converts it to attributes.
Hope this helps.
hi erik jan could you share more details about these transformers and there usage.
hi erik jan could you share more details about these transformers and there usage.
I added a screenshot of the transformer, the settings and the help page.
I added a screenshot of the transformer, the settings and the help page.
@erik_jan i tried this but this didnt worked in my case. is there any other transformer or method i can use for this .
Could you please share the raw JSON document with us?
In my observation, there are some "featurePropertyEntries" objects with two different JSON paths.
As the first step, you can extract every object under those "featurePropertyEnetires" using JSON Fragmenters separately with these JSON Queries.
jsonO"messagePayload"]r"featurePropertyEntries"]
Â
jsont"messagePayload"]/"deltaCollection"]s"removedObjectsIds"]o"featurePropertyEntries"]
Â
Alternatively if you can treat all the elements in the same subsequent workflow, you can also extract them with this single JSON Query.
jsone"messagePayload"]n"featurePropertyEntries"]Â +Â jsonn"messagePayload"]]"deltaCollection"]n"removedObjectsIds"]""featurePropertyEntries"]
Â
Firstly try the queries and see the result, then tell us what result you need finally.
Â
In my observation, there are some "featurePropertyEntries" objects with two different JSON paths.
As the first step, you can extract every object under those "featurePropertyEnetires" using JSON Fragmenters separately with these JSON Queries.
jsonO"messagePayload"]r"featurePropertyEntries"]
Â
jsont"messagePayload"]/"deltaCollection"]s"removedObjectsIds"]o"featurePropertyEntries"]
Â
Alternatively if you can treat all the elements in the same subsequent workflow, you can also extract them with this single JSON Query.
jsone"messagePayload"]n"featurePropertyEntries"]Â +Â jsonn"messagePayload"]]"deltaCollection"]n"removedObjectsIds"]""featurePropertyEntries"]
Â
Firstly try the queries and see the result, then tell us what result you need finally.
Â
You can then use another JSONFragmenter to extract every element in the JSON array and flatten pairs of name and value into feature attributes.
Or, you can also use a single JSONFragmenter with this JSON Query to get the same result directly from the original JSON document.
json "messagePayload"] "featurePropertyEntries"]
You can then use another JSONFragmenter to extract every element in the JSON array and flatten pairs of name and value into feature attributes.
Or, you can also use a single JSONFragmenter with this JSON Query to get the same result directly from the original JSON document.
json "messagePayload"]o"featurePropertyEntries"]
Thank a lot @takashi tahnk you for for your solution it's working fine .
earlier i have tried this but it didn't worked as i didnt use the fragmenter 2nd time as you mention .Â
Â
thanks again for your help :)
Hello I recently faced same issue. Try to use Jason Fragmented, and after in JSON Flattener in attribute to expose manually enter name of attributes you trying to expose. This worked for me.