Support Questions

Find answers, ask questions, and share your expertise

convert json to csv in nifi

avatar
New Contributor

Hi,

I am trying to convert json to csv in nifi. My json is something like below 

{"tokens":["12343455577666","2134421241241","124142141411445","21425654768686"]}

and my csv should be like below

tokens

12343455577666

2134421241241

124142141411445

21425654768686

Please help me. Thanks!

10 REPLIES 10

avatar
Super Guru

@Kiranq,

What I found is that the JoltTransformRecord expects only single record to work with hence the name. I noticed when I try to pass an array I was getting the error "...error transforming the first record", however if I pass just one json record it works. If you have an array of json\csv and you are looking to split and process each record individually then I would suggest that you split the records before the JoltTransformRecord. If you dont want to split the array then I recommend using JoltTranformJson first and then use Convert Record processor to convert to CSV.