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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
hiba1
Contributor
Contributor

Create JSON file

Hi,

I have a csv file with one culonne "hotelId".

I want to create a json file with those IDs.

the json file must be like this one :

{

  

"unicaIds"

: [

    

15796781

,

    

16566288

  ]

}

How can i do this with talend ...any help please!

Labels (3)
1 Solution

Accepted Solutions
gjeremy1617088143

Hi @hiba chaieb​ 

I use tDenormalize to put the hotel id into a list separated by a comma

then in the tWriteJsonField i select remove root node and add a sub element named unicalds when i drag and drop hotelId on it I select Add linker to target node

I right click on it and select as loop element , then I add it an attribute named class and I right click on it and select set a static value and I set it to array

finally I use a treplace to remove double quote after [ and before ].

Send me Love and Kudos

View solution in original post

2 Replies
gjeremy1617088143

0695b00000H8opDAAR.jpg0695b00000H8op3AAB.jpg0695b00000H8oojAAB.jpg0695b00000H8ojVAAR.jpg0695b00000H8ooUAAR.jpg0695b00000H8ooFAAR.jpg0695b00000H8ooAAAR.jpgI use a tfixedflowinput to simulate your dataset

gjeremy1617088143

Hi @hiba chaieb​ 

I use tDenormalize to put the hotel id into a list separated by a comma

then in the tWriteJsonField i select remove root node and add a sub element named unicalds when i drag and drop hotelId on it I select Add linker to target node

I right click on it and select as loop element , then I add it an attribute named class and I right click on it and select set a static value and I set it to array

finally I use a treplace to remove double quote after [ and before ].

Send me Love and Kudos