Skip to main content
Solved

json output remove top levels


oliver.morris
Contributor
Forum|alt.badge.img+12

Hi, I have created some JSON in FME but would like to remove the first couple of levels.

At the moment I have:

[
    {
        "output" : {
            "status" : "200",
            "body" : [
                {
                    "well_id" : 25325,
                    "well_name" : "MYALL_CREEK_3",
                    "latitude" : -27.046011,
                    "longitude" : 149.236806
                },
                {etc

ideally I would like to remove the "output" level

[
    {
            "status" : "200",
            "body" : [
                {
                    "well_id" : 25325,
                    "well_name" : "MYALL_CREEK_3",
                    "latitude" : -27.046011,
                    "longitude" : 149.236806
                },
                {

Could you please tell me how to achieve this.

For reference my workbench looks like:

0684Q00000ArBCfQAN.png

 

Many Thanks,

Oliver

 

Best answer by david_r

Since you're already using the JSONTemplater, I would suggest that you simply use the TEXTFILE writer rather than the JSON writer. Simply change the JSONFormatter output attribute to "text_file_data" and you should be ready to go.

That should accomplish what you're asking.

View original
Did this help you find an answer to your question?

2 replies

david_r
Evangelist
  • Best Answer
  • March 23, 2018

Since you're already using the JSONTemplater, I would suggest that you simply use the TEXTFILE writer rather than the JSON writer. Simply change the JSONFormatter output attribute to "text_file_data" and you should be ready to go.

That should accomplish what you're asking.


oliver.morris
Contributor
Forum|alt.badge.img+12
  • Author
  • Contributor
  • March 23, 2018

perfect, yes that did the job


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