Support Questions
Find answers, ask questions, and share your expertise

How to convert Nested JSON format in Apache Nifi

Explorer

Hi,

 

I have JSON Data like this:

 

{
"ID" : "10",
"Type" : [ "def", "abc", "mn" ],
"Name" : [ "xyz", "wxf", "pp" ]
}

 

My desired JSON output is:

 

{
"ID" : "10",
"Type" : "def",
"Name" : "xyz"
},
{
"ID" : "10",
"Type" : "abc",
"Name" : "wxf"
},
{
"ID" : "10",
"Type" : "mn",
"Name" : "pp"
}

 

 

Any help in this issue will be greatly appreciated.

Thank You!

3 REPLIES 3

Expert Contributor

Hi,

 

Have you tried using JsonJolt processor. Its like json transformation from one format to another. Im not Json jolt expert myself but I found a link that might help you in what you are trying to do:

https://www.titanwolf.org/Network/q/1600720e-fcfb-4711-bce6-4cca97006d16/y

 

Explorer

Hi @SAMSAL I have followed the link it is working good but issue is it is not printing ID from outer body

Expert Contributor

can you share the jolt script so I can take a look?

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.