Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

JSON File creation using Context from Parent Job

Highlighted
Five Stars

JSON File creation using Context from Parent Job

Hi Team ,

I  want to create a  json file as which  is shown in image Sample jSONSample jSON

Can you please guide me how to achieve this ? 
Tags (1)
Highlighted
Moderator

Re: JSON File creation using Context from Parent Job

@gtaware,  paas the context to child job that child job should be tFixedFlowInput>>tWriteJsonFields>>tFileOutputRow.

 

 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Highlighted
Five Stars

Re: JSON File creation using Context from Parent Job

Thanks Let me try that.

Highlighted
Five Stars

Re: JSON File creation using Context from Parent Job

Can you please create a sample Job and Post a reply here . 

Highlighted
Moderator

Re: JSON File creation using Context from Parent Job

@gtaware , please share the job what you have tried?

 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Highlighted
Five Stars

Re: JSON File creation using Context from Parent Job

Auidt_Error_log.png

Highlighted
Moderator

Re: JSON File creation using Context from Parent Job

@gtaware ,OK ,the job is completed successfully right  validate the json data that have you got correct as you expected?

 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Highlighted
Five Stars

Re: JSON File creation using Context from Parent Job

I have posted the Job which has been created but that is not a complete Json which I am expecting .  

how to add other details which I have shown in very first image . 

 

 
Highlighted
Five Stars

Re: JSON File creation using Context from Parent Job

Hi Team,

Can you please help me how to add  sub element which contains array in tWriteJsonField component 

Below is array which I want to add in my existing json file which I am creating using tWriteJsonField 

"additonalDetails": {
"nvPair": [
{
"name": "fileId",
"value": "10306"
},
{
"name": "fileName",
"value": "ACCULYNK.WUDPGBP.20200129.txt"
}
]
}

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Self-service Talend Migration: Moving from On-Premises to the Cloud

Move from On-Premises to the Cloud by following the advice of experts

Read Now