Use the Replace Values action to replace any value in a pipeline with a different value. You can choose from three search methods: Literal, Mask, or Regular Expression, depending on your cleansing needs.
To add a Replace Values action
- In the Cleanse Data step, click + Add Action.
- From the dropdown, select Replace Values.
- From the Field dropdown, choose the field you want to clean.
- Under Search Method, select one of the following options:
- Literal
- Mask
- Regular Expression
Search Method: Literal
Use Literal to match and replace exact text values.
- Choose the operator available for the Exact match from the drop-down:
- Equals
- Contains
- Starts with
- Ends with
-
Replace section: For each row:
- Enter a Search Value.
- Enter a Replacement Value.
-
You can enable case sensitivity for the operator in the Settings options.
-
To replace any value with a space or a tab, simply select the desired option from the Ellipses icon menu.
Note: In the Literal search method, selecting the Starts
with, Ends with or Equals option automatically hides the
Occurrence selection.
Example:
| Exp | Replacement | Before | After |
|---|---|---|---|
| United States | USA | United States | USA |
Search Method: Mask
Use Mask to define pattern-based matches using wildcards.
- Replace section: In each row:
- Enter a Mask Pattern in Search Value
- Enter a Replacement Value
Example:
| Exp | Replacement | Before | After |
|---|---|---|---|
| NNN | ### | 253-09-0023 | ###-09-0023 |
Search Method: Regular Expression
Use Regular Expression to apply advanced pattern matching.
- Replace section: In each row:
- Enter a Regular Expression in Search Value
- Enter a Replacement Value
| Exp | Replacement | Before | After |
|---|---|---|---|
| [\w.-]+@[\w.-]+\w+ | [EMAIL REDACTED] | john.doe@test.com | [EMAIL REDACTED] |
Tip:
- Regular expressions follow standard regex syntax.
- Use anchors (^, $), groups, or quantifiers as needed.
- Make sure expressions are tested for correctness, as incorrect patterns may produce no replacements.
Finalizing the Action
Once all replacement rows are added:
- Review the rows for accuracy.
- Define the occurrence to accurately count and replace each instance independently within individual fields.
- Click Apply to save the action.
- The action now appears in the Cleanse Data step's action list.
You can add multiple Replace Values actions, each with a different field or search method.