Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
anitha_manohar
Contributor
Contributor

Building Complex JSON message in Talend

Hi,

Im trying to build a complex JSON message using Talend, but not sure which component to use. TfileOutputJson doesn’t seems to have options to create complex JSON ot I’m not sure how to use it.

Is it possible to build complex JSON Output like below with Talend components or should we use tJava to do it in Java.

Thanks for your help.

sample json:

{

"destination_addresses"

:

[

"Philadelphia, PA, USA"

],

"origin_addresses"

:

[

"New York, NY, USA"

],

"rows"

:

[{

"elements"

:

[{

"distance"

:

{

"text"

:

"94.6 mi"

,

"value"

:

152193

},

"duration"

:

{

"text"

:

"1 hour 44 mins"

,

"value"

:

6227

},

"status"

:

"OK"

}]

}],

"status"

:

"OK"

}

Labels (3)
5 Replies
Anonymous
Not applicable

Hi

Take a look at tWriteJsonField component and try it, let me know if it meets your need.

 

Regards

Shong

Anonymous
Not applicable

Building such complex json document with adding sub-documents ist not possible with the build-in components. You should consider using the tJSONDoc* components.

Please checkout the documentation: https://github.com/jlolling/talendcomp_tJSONDoc/blob/master/doc/tJSONDoc.pdf

anitha_manohar
Contributor
Contributor
Author

Hi,

 

Thank you so much. I was able to build that JSON with tWriteJSONField.

anitha_manohar
Contributor
Contributor
Author

Thanks for your Help. But tWriteJSONField worked.

Anonymous
Not applicable

Great, thanks for your feedback! ??