Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Update Json field via Nifi

avatar
Explorer

I have a json like this coming from an input port:

 

{
"url": "blablabla",
"keyword": "foo"
}

 

then I have to generate a new json to pass to a post call. The new json is something like this:

 

{
    "requests": [
        {
            "source": "blablabla",
            "params": {
                "keywords": [
                    "something"
                ],
                "sub-field1": "1"
           }
        }
    ],
    "field1": "1",
    "field2": "2",
    "field3": false
}

 

where the array keywords should be replaced with a new array with the value of the previous Json ("foo"). The resulting is:

 

 

 

{
    "requests": [
        {
            "source": "blablabla",
            "params": {
                "keywords": [
                    "foo"
                ],
                "sub-field1": "1"
           }
        }
    ],
    "field1": "1",
    "field2": "2",
    "field3": false
}

 

then i pass this json to a invokehttp to call the post. 

 

Could you please explain me how to generate this flow?

 

thanks

 

 

1 ACCEPTED SOLUTION

avatar
Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
3 REPLIES 3

avatar
Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Explorer

Hi @adhishankarit, thanks for your response....one question...I don't see the link to download the xml..where i can find it?

avatar
Contributor

 Hi alexmarco,

 

I did not find the 'Upload/Attach' option to upload the template file . Could you please follow the steps/screenshots mentioned , it should work for your example well.

 

thanks