Skip to main content
sahil0915
Silver ⭐️⭐️
April 15, 2022
Solved

add node in json array using Apache nifi

field to add 

"quality" 

input json :

{
"json_data": {
"id": "1234",
"items": [
{
"id": "000000",
"metadata": {
"newId": "82896888047600"
}
}
]
}
}

 output json :

 

{
"json_data": {
"id": "1234",
"items": [
{
"id": "000000",
"metadata": {
"newId": "82896888047600",

"quality" :"good"
}
}
]
}
}

 

 

araujo
araujoAnswer
Platinum ⭐️⭐️⭐️
April 21, 2022

@sahil0915 ,

 

Please try the JoltTransformJSON processor with the following Chain specification:

[
{
"operation": "default",
"spec": {
"json_data": {
"items[]": {
"*": {
"quality": "good"
}
}
}
}
}
]

 

Cheers,

André

 

-- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.

1 reply

araujo
Platinum ⭐️⭐️⭐️
araujoAnswer
Platinum ⭐️⭐️⭐️
April 21, 2022

@sahil0915 ,

 

Please try the JoltTransformJSON processor with the following Chain specification:

[
{
"operation": "default",
"spec": {
"json_data": {
"items[]": {
"*": {
"quality": "good"
}
}
}
}
}
]

 

Cheers,

André

 

Translate
-- Was your question answered? Please take some time to click on "Accept as Solution" below this post. If you find a reply useful, say thanks by clicking on the thumbs up button.