Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to create more complex JSON files with tFileOutputJSON

I have used tFileOutputJSON as it is described in the documentation. This works without any problems.
However, this way I can only create very basic JSON documents, they have got this structure, for example:
{
"person":
}

Real world examples are more complex. How do I create same. Do I have to use List / Document or other Types in the Schema?
Is there any explanation, or any example / demo anywhere? Or do I have to try out by myself?

Thanks for help,
Kai
Labels (3)
5 Replies
Anonymous
Not applicable
Author

I have the same question.
How to write into a file multi level JSON structure?
Anonymous
Not applicable
Author

Hi
Use a tWriteJsonFields to write a complex json string and output the string result to a file with tFileOutputDelimited. About the supported json types, you can refer to the following links:
https://www.talendforge.org/forum/viewtopic.php?pid=157898#p157898
https://jira.talendforge.org/browse/TBD-1067
Best regards
Shong
Anonymous
Not applicable
Author

Hi
Use a tWriteJsonFields to write a complex json string and output the string result to a file with tFileOutputDelimited.

Thanks. 
It works but anyway I need some custom coding to make a usable JSON file.
Anonymous
Not applicable
Author

Actually it works quite strangely.
I need to create a JSON file like that the one I attached: json_sample.txt.txt
One instance of  tWriteJsonField isn't enough to write the JSON because there is no way to create arrays. Possible solution may be to use one tWriteJsonField for each array I need in my final JSON and then construct an array using string manipulations (adding []) and then put it all together. 
The same in both Talend Open Studio and "full" version of Talend Studio.
ragraw22
Contributor
Contributor

 @mhodent Hey, Can you explain what you did to create a multilevel nested array json structure.