Is JSON Structure handling difficult?
Learn And Grow

Is JSON Structure handling difficult?

Actually not, If you understand the JSON structure. In this article we are going to see about the objects within JSON array.

So, Input structure will be like this. here there are six columns in this data.

Article content
Input data

Now, our output will be like this. Yes, we can use tWriteJSONField to create this structure, but the challenge is we can't get the array format if it single data. But we can achieve this below mentioned way.

Article content
Output data

We can read the input file in tFileInputDelimited component.

Article content
Job Structure

Now, configure the tWriteJSONField, if we double click the component we can get configure tree, there we can do all the mappings. before that, for looping purpose we can add dummy value as mentioned in the below image. (refer this - already we have discussed the same for xml structure).

Article content
tFileInputDelimited Configuration

tWriteJSONField

Once mapped all the values. we need to add the class attribute. Once dialogue box opened we need to mention it as class. In fixed value we need to mention it as array for outer level, and object for next level of values.

Article content
tWriteJSONField configure tree
Article content
adding class attribute

Now, In tWriteJSONField configuration we need to set the group by value and disable the remove root node option in the component.

Article content
tWriteJSONField configuration

Now if we run the job we'll get the required output.














I make json requests from talend every day, and I get stuck in it every now and then. This helped me. Thank you so much

Thanks Sneha! I was stuck trying to get the array formatting with single data and this resolved it.

To view or add a comment, sign in

More articles by Sneha A

Explore content categories