Value Replacer (deprecated)
The Value Replacer replaces values in fields.
- Replace field values with nulls, optionally based on a condition
- Replace null values in specified fields with constants
- Replace field values with constants based on a condition
When you configure the processor, you specify the fields that you want to use, and the conditions and replacement values when appropriate. You can list multiple fields for each type of value replacement. And you can configure error handling for when a field does not exist.
Processing Order
- Fields to Null - Replaces existing values with null values, optionally based on a condition.
- Replace Null Values - Replaces null values with the specified constants.
- Conditionally Replace Values - Replaces the specified values with constants based on a condition.
For example, in the following Value Replacer, the processor first replaces null values in the product_id field, then replaces the "0289" store ID with "0132". And finally, it replaces values less than 1.00 in the cost field with "1.00":
When you list multiple fields in a property, Value Replacer processes them in the listed order as well.
Replacing Values with Nulls
You can use Value Replacer to replace values in a field with null values. You can replace all values with nulls or you can replace values based on a condition.
${str:length(record:value('/stringField')) == 0}
${record:value('/intField') < 0}
Use the
Fields to Null property to replace values with nulls. When
you enter a condition, it applies to all listed fields. Replacing Values with Constants
You can replace values in a field with a constant, based on a simple condition.
You might use conditional replacement to update codes or other changed values, or to replace invalid values.
- Less than ( < ) - Converts all values less than the specified value to the replacement value.
- Greater than ( > ) - Converts all values greater than the specified value to the replacement value.
- Equals ( = ) - Converts the specified value to the replacement value.
- ALL - Converts all values in the field to the replacement value.
Use the Conditionally Replace Values property to replace values with a constant.
Data Types for Conditional Replacement
- Byte
- Double
- Float
- Integer
- Long
- Short
- String