[ https://issues.apache.org/jira/browse/NIFI-4368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046582#comment-17046582 ]
karthik kadajji edited comment on NIFI-4368 at 2/27/20 12:50 PM: ----------------------------------------------------------------- Hi [~markap14] , I was trying to reproduce the error. Could you please let me know the way you defined the schema. For the updateRecord , I have used the property "Replacement Value Strategy" and with the property value "Literal Value" . I was able to successfully update the field(/numbers[1]) to 8 for my flowfile. Regards, Karthik was (Author: karthikkadajji): Hi Mark , I was trying to reproduce the error. Could you please let me know the way you defined the schema. For the updateRecord , I have used the property "Replacement Value Strategy" and with the property value "Literal Value" . I was able to successfully update the field(/numbers[1]) to 8 for my flowfile. Regards, Karthik > UpdateRecord fails if attempting to set a particular array element to some > other value > -------------------------------------------------------------------------------------- > > Key: NIFI-4368 > URL: https://issues.apache.org/jira/browse/NIFI-4368 > Project: Apache NiFi > Issue Type: Bug > Components: Extensions > Reporter: Mark Payne > Assignee: Mark Payne > Priority: Major > > I have the following record: > {code} > { > "id" : 3, > "numbers" : [1, 2, 3] > } > {code} > I tried using UpdateRecord with a property name of "/numbers[1]" and a > literal value of "8" but > the data was not modified. It appears to be due to the fact that the > ArrayIndexFieldValue class uses the following code: > {code} > @Override > public void updateValue(final Object newValue) { > getParentRecord().get().setArrayValue(getField().getFieldName(), > getArrayIndex(), newValue); > } > {code} > But the field was constructed using a field name of "numbers[1]" instead of > "numbers". -- This message was sent by Atlassian Jira (v8.3.4#803005)