Hi Paul,

Can you use the “concat” function from record path?

In UpdateRecord you would add a property with the key of /combined and the
value of concat(/field1, ‘ ‘, /field2)

https://nifi.apache.org/docs/nifi-docs/html/record-path-guide.html

You’d have to set the Replacement Value Strategy to Record Path Value.

-Bryan


On Wed, Nov 29, 2017 at 8:41 PM Paul Riddle <[email protected]>
wrote:

> Hi All,
>
> I am trying to find a way to build a better mouse trap.  My scenario is
> this:
> Schema:
> {
>   "name": "Sample Schema",
>   "namespace": "nifi.examples",
>   "type": "record",
>   "fields": [
>     { "name": "field1", "type": "string" },
>     { "name": "field2", "type": "string" },
>     { "name": "field3", "type": "string" }
>     { "name": "combined", "type": "string" }
>   ]
> }
>
> Say I have a CSV file:
> field1,field2,field3
> John,Mike,Lisa
>
> I want to use an UpdateRecord to create a new field in each record called
> "combined" with a value of "Mike Lisa" from field2 and field3
>
> I am having difficulty finding a way to do that without using
> PartitionRecord to add field values to attributes and then using expression
> language to reference them in UpdateRecord to define the value of the
> "/combined" field.
>
> Is there a way to reference the field.value variable of another field in
> UpdateRecord and cut out PartitionRecord in this scenario?
>
> What I am looking for is something like ${field.value:field2()}
> ${field.value:field3()} if something like that exists.
>
> Regards,
> Paul
>
> --
Sent from Gmail Mobile

Reply via email to