Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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"
}
Hi
Take a look at tWriteJsonField component and try it, let me know if it meets your need.
Regards
Shong
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
Hi,
Thank you so much. I was able to build that JSON with tWriteJSONField.
Thanks for your Help. But tWriteJSONField worked.