tWriteJson field output not working

Eight Stars

tWriteJson field output not working

I have some input data which I need to get converted to a json object. I am half-way there, but, cannot pin-point what to do to get it fully working. Any help is appreciated.

 

Original OP: 

abc;pqr;123
def;ghj;876

Expected JSON Object:

{
   "test_op":[
      {
         "lname":"abc",
         "fname":"pqr",
         "score":"123"
      },
      {
         "lname":"def",
         "fname":"ghj",
         "score":"876"
      }
   ]
}

Accepted Solutions
Six Stars

Re: tWriteJson field output not working

hello,

can you look that corresponds to your expectation?(example3)

 

 


All Replies
Eight Stars

Re: tWriteJson field output not working

Shameless bump. I am unable to find a way to get the expected JSON output using tWriteJsonField. Any suggestion on how to mark an item as "Group"? Any other alternatives to creating a json object?

Thanks.
Moderator

Re: tWriteJson field output not working

Hello,

Sorry for delay.

We will check your attachment test_json.zip file and then come back to you as soon as we can.

Thanks for your time.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: tWriteJson field output not working

hi,

what is your expected JSON output? (Structure).

Have an input and output example?

 

 

 

Six Stars

Re: tWriteJson field output not working

hello,

can you look that corresponds to your expectation?(example3)

 

 

Eight Stars

Re: tWriteJson field output not working

Thank you so much. Example 3 worked for me. I am still baffled on why we need that "field1" value to be included in the grouping option (input and output). Other than that, it worked flawlessly. Thank you so much.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch