How can i build a JSON output with (multiple) loops?

Highlighted
Five Stars

How can i build a JSON output with (multiple) loops?

I'm trying to build a JSON output with more than 1 loop. i was able to build an XML using the 'append' feature of tFileOutputMSXML but couldn't find something similar for JSON.

 

As the snapshot shows, i can only loop on address but not on communications at the same time.


Accepted Solutions
Eight Stars

Re: How can i build a JSON output with (multiple) loops?

The tWriteJsonField component seems a little lacking on features while working with complex json objects. I have tried using a custom Talend Component "tJSONDoc" (https://github.com/jlolling/talendcomp_tJSONDoc)

The documentation can be a little confusing in the beginning. If you want to post more info on the intended output structure and what you were able to come up with, please share here.
HTH

PS: I am still learning this component, and so far, I have had multiple success overall using this component in creating complex objects.

All Replies
Eight Stars

Re: How can i build a JSON output with (multiple) loops?

The tWriteJsonField component seems a little lacking on features while working with complex json objects. I have tried using a custom Talend Component "tJSONDoc" (https://github.com/jlolling/talendcomp_tJSONDoc)

The documentation can be a little confusing in the beginning. If you want to post more info on the intended output structure and what you were able to come up with, please share here.
HTH

PS: I am still learning this component, and so far, I have had multiple success overall using this component in creating complex objects.
Five Stars

Re: How can i build a JSON output with (multiple) loops?

Thank you for the custom component. I've seen it before but i thought maybe Talend can do it without having to go into installing something external.

Will try to post the end flow when im done..

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch