One Star

How to specify a JSON array using the tWriteJSONfield Control

I am trying to configure the tWriteJsonField control to create an output JSON file with the following structure:

    }
  },
  {
    "type": "configuration/entityTypes/Well",
    "attributes": {
      "API":
    }
  }
]
The closest I have been able to get is:
   <----- Missing the open square bracket
  {
    "type": "configuration/entityTypes/Well",
    "attributes": {
      "API":
    }
  }      <----- Missing the comma
  {
    "type": "configuration/entityTypes/Well",
    "attributes": {
      "API":   <----- Missing the open square bracket
        {
          "value": "031-9999"
        }
   <----- Missing the close square bracket
    }
  }
   <----- Missing the close square bracket
The "Configure JSON tree" set up I'm using is in the attached image file.
I've been trying to get this work for several days and have searched Google, but all the examples I can find are much simpler than what I'm trying to do.
Appreciate any help you can provide.
1 REPLY
One Star

Re: How to specify a JSON array using the tWriteJSONfield Control

I am also having this issue.  I've spent days on this and can't find a solution in Talend or anywhere online.  From my experience, tWriteJSONField doesn't support an "outermost array" square bracket (outermost, not nested).  Even if you try loop/group loop on whatever object/variable you specify to be the outermost array, it doesn't create an array bracket.  I've even tried adding an addition level so everything would be grouped thus producing an array list, no go.
Please help!