Created 03-22-2018 08:51 PM
I have a flow file content like below
{
"atct": [
{
"flag": "Y",
"atct_no": 123456789,
"debr" : "EAR"
},
{
"flag": "Y",
"atct_no": 234567891,
"debr" : "EYE"
}
]
}
And then I have an attribute Attr_X which has value - [ "2020202020", "1010101010"]
I would like to replace "atct_no" values in flow file content and I need it to look like (if possible with out splitting the flow file)
{ "atct": [ { "flag": "Y", "atct_no": 2020202020, "debr" : "EAR" }, { "flag": "Y", "atct_no": 1010101010, "debr" : "EYE" } ] }
Created 03-22-2018 09:04 PM
Have you tried UpdateRecord ? https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.5.0/org.apache...
Look to the additional details for exmaples https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.5.0/org.apache...
Created 03-23-2018 03:19 PM
Thank you very much for the quick reply. Now I did go through the update processor. The issue I am unable to figure out is, how to reference the array of Attribute values in update processor. To my initial question there are two records in Jason file and 2 values in attribute "Attr_X". So I want the first value of "atct_no" which is 123456789 to be replaced by 2020202020, and in the same way 234567891 to be replaced by 1010101010.
Thank you,
Raja
Created on 03-23-2018 04:25 PM - edited 08-18-2019 12:24 AM
You can add an UpdateAttribute to split the attribute into two attributes like this. Then you can use myatt1 or myatt2 separately.