Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
cara_ay
Contributor II
Contributor II

Creating array and objectis using tWriteJSONfile

Hi,

I'm having trouble to creating the below structure using tWriteJSONField but can't seem to get the component working. Would anyone know how to structure this using the tWriteJSONField component?

 

Here is the desired output.

0695b00000IdXT1AAN.png 

But this is what I'm getting from the Talend output.

{"content":[{"type":"cms_image","body":{"altText":"Screenshot","title":"

Screenshot

","source":{"ref":"assets/uploaded-files/2021-08/

Screenshot

.jpg"}}}]}

{"content":[{"type":"cms_image","body":{"altText":"

Screenshot2

","title":"

Screenshot2

","source":{"ref":"assets/uploaded-files/2021-08/

Screenshot2

.jpg"}}}]}

 

Here is my XML tree structure.

0695b00000IdXUOAA3.png 

Anyone who has any ideas on how I might be able to fix this? Thanks!

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

@Cara Au Yeung​ , add a group element to merge input rows to one output row. see

0695b00000IdlcvAAB.png0695b00000Idld0AAB.png0695b00000IdldPAAR.png 

 

Output:

{"content":[{"type":"type1","body":{"alttext":"screesnot1","title":"title1","source":"ref1"}},{"type":"type2","body":{"alttext":"screesnot2","title":"title2","source":"ref2"}}]}

 

Please try again.

 

Regards

Shong

View solution in original post

2 Replies
Anonymous
Not applicable

@Cara Au Yeung​ , add a group element to merge input rows to one output row. see

0695b00000IdlcvAAB.png0695b00000Idld0AAB.png0695b00000IdldPAAR.png 

 

Output:

{"content":[{"type":"type1","body":{"alttext":"screesnot1","title":"title1","source":"ref1"}},{"type":"type2","body":{"alttext":"screesnot2","title":"title2","source":"ref2"}}]}

 

Please try again.

 

Regards

Shong

cara_ay
Contributor II
Contributor II
Author

Hi @Shicong Hong​ , thank you so much - that worked perfectly 🙂