Support Questions

Find answers, ask questions, and share your expertise

replace an empty values with "N/A" using replaceText processor

avatar

in the flowfile I have two attributes address and city, and both of them are returned empty. thank you for your help

3 REPLIES 3

avatar

The format of the flowfile is Json

{

"Name": "XXX",

"Address": " ",

"city": " ",

"Country": "USA"

}

but I want it to show like this instead

{

"Name": "XXX",

"Address": "N/A ",

"city": " N/A",

"Country": "USA"

}

avatar
Master Guru
@Sam LL

Search for white space in double quotes and replace that with "N/A"

79414-replacetext.png

Search Value

"\s"

Replacement Value

"N/A"

Character Set

UTF-8

Maximum Buffer Size

1 MB //needs to change this value according to your flowfile size

Replacement Strategy

Regex Replace

Evaluation Mode

Entire text

avatar

@ShuThank you very much