Skip to main content
Solved

json output remove top levels

  • March 23, 2018
  • 2 replies
  • 29 views

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

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 8394 replies
  • 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+14
  • Author
  • Contributor
  • 176 replies
  • March 23, 2018

perfect, yes that did the job