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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] unexpected format in tFileOutputJson output

Hi,
I am getting invalid format in tFileOutputJson as below
{"data":}
Please refer to http://www.talendforge.org/forum/viewtopic.php?pid=132011#p132011 about input data and design.
Output on the console is correct output for the same job.
XMLSerializer INFO Using default type string
{"employee":{"id":"1","name":"Simon","lastname":"Tod","training":{"trainingCode":"AX2","trainingCost":"2345"}}}
How to correct output json file? I am using TOS5.3.
Thanks
Vaibhav
Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,
Following were small changes which needs to consider for getting correct json file.
1) Select the output column as training in tWriteJsonField which was the loop element in Json tree
2) Remove delimiter in tFileOutputDelimited use only "", else the file is pre or post fixed by delimiter for those many number of columns
Thanks
Vaibhav

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi Vaibhav
tFileOutputJson don't provide a GUI for configuring Json tree, this component is just designed to outputs a simple json file with only one data block, if you want to output a complex Json file, you need to use tWriteJsonField which provides a GUI for configuring complex Json tree, and link tWriteJsonField to a tFileOutputDelimited to output the result as a json file. For example:
tFixedFlowInput--main--tWriteJsonField--main-->tFileOutputDelimited
Shong
Anonymous
Not applicable
Author

Hi,
Following were small changes which needs to consider for getting correct json file.
1) Select the output column as training in tWriteJsonField which was the loop element in Json tree
2) Remove delimiter in tFileOutputDelimited use only "", else the file is pre or post fixed by delimiter for those many number of columns
Thanks
Vaibhav