Skip to main content

Hello everyone,

 

I need to extract data from a json file. The problem is that I cannot use json extractor becuase the format of the json is a pit different. Can anyone of you guys help me with this?. I have attatched an example of the json file. I need to get all values under "attributes". When I try to extract the needed values I get an empty fields.

@takashi​ I hope you have sometime to have a look 🙏

 

Kind Regards,,,

Hi @mda​ , I think what you need is to fragment the JSON array named "attributes" and flatten every fragmented object. You can use either the regular JSON reader or the JSONFragmenter to do that.

 

JSONReader: In the Add Reader dialog, after specifying Format and selecting the file as its Dataset, open the reader parameters dialog and set the parameters with JSON Query mode, like this. Here, Feature Type name can be any.

json-reader-parameters

 

 

JSONFragmenter: Set the parameters like this.

jsonfragmenter-parameters

 

 

Other than entering a JSON Query into the Query column field directly, you can also use the Select Query dialog, in either the JSON Reader or the JSONFragmenter.

select-query


Hi @mda​ , I think what you need is to fragment the JSON array named "attributes" and flatten every fragmented object. You can use either the regular JSON reader or the JSONFragmenter to do that.

 

JSONReader: In the Add Reader dialog, after specifying Format and selecting the file as its Dataset, open the reader parameters dialog and set the parameters with JSON Query mode, like this. Here, Feature Type name can be any.

json-reader-parameters

 

 

JSONFragmenter: Set the parameters like this.

jsonfragmenter-parameters

 

 

Other than entering a JSON Query into the Query column field directly, you can also use the Select Query dialog, in either the JSON Reader or the JSONFragmenter.

select-query

Thank you ver much! That helps. I always mislocating the

  • .


  • @Takashi Iijima​ ​ Further to my previous question, I get now two attributes "Naam" en "Value". The contents of the "Naam"attribute are actually attributes names and the contents of the "Value"attrbute are the values. So what I need is to transpose the "Naam" attribute to columns and fill those columns with the content of the "Value"attribute (see attachments). I have tried attributepivoter and also attribute Transposer custom transformer. Unfortunatley, I keep getting nothing useful or empy output. Could you please help me with this!


    This is the wanted results form wanted result


    This is the wanted results form wanted result

    Looks like you got an answer to your question here: https://community.safe.com/s/question/0D54Q00008NouBwSAJ/how-can-i-transpose-a-column-which-was-extracted-from-a-json-file


    Yes, I needed to use AttributeExposer after the AttributeTranspose :)


    Reply