Skip to content

Find Replace Task

Overview

The Find Replace Task performs multiple find-and-replace operations on text in a single step. Clean data, normalize formats, remove unwanted characters, convert between formats, or sanitize content by applying sequential text replacements.

When to use this task:

  • Text normalization and standardization
  • Data cleaning and formatting
  • Remove or replace unwanted characters
  • Convert between data formats
  • Sanitize user input
  • Template variable replacement
  • Format conversion (dates, addresses, etc.)
  • Character encoding fixes

Key Features:

  • Multiple find/replace operations in sequence
  • Regex special character escaping
  • Global replacement (all occurrences)
  • Case-sensitive matching
  • Unlimited replacement pairs
  • Variable support
  • Sequential processing

Quick Start

1. Add Find Replace task
2. Enter source text
3. Add find/replace pairs
4. Replacements applied in order
5. Save

Configuration

Builder fields

The Field column is the label as it appears in the task builder; Key is the name the value is stored under and referenced by.

Field Key Type Default Notes
Input Text text_input text –
Find & Replace Rules find_replace_rows dyn-rows –

Source Text

Input: {{task_55001_address}}
Input: {{task_2001_email_body}}
Input: Hello World! Price: $100

The text to perform replacements on.

Find/Replace Pairs

Find: "  " (double space) → Replace: " " (single space)
Find: "\n" → Replace: "<br>"
Find: "$100" → Replace: "$99.99"
Find: "!" → Replace: "."

Add as many pairs as needed. Applied sequentially.

Output Fields

Field Description Example
task_34001_run Success status true
task_34001_run_text Result message Successfully replaced text.
task_34001_output Text after replacements Hi World. Price: $99.99

Real-World Examples

Strip formatting out of a reference

Webhook In
  └─ Find Replace   remove spaces and dashes
      └─ Match to Client   o_client_id: {{task_34001_output}}

Redact a value before it leaves the system

Email Trigger
  └─ Find Replace    replace the account number with "[REDACTED]"
      └─ Webhook Out  send {{task_34001_output}}

Tidy pasted text before storing it

Form Submission
  └─ Find Replace   collapse double spaces, remove stray punctuation
      └─ Workflow Note   log {{task_34001_output}}

All the replacements you configure run in one pass, in the order you list them, so a later rule sees the result of an earlier one.

Best Practices

Order Matters

Replacements apply sequentially. Earlier changes affect later ones.

Example:
Input: "test TEST Test"

Option 1 (convert then remove):
1. Find: "test" → Replace: "TEST"  # Result: "TEST TEST Test"
2. Find: "TEST" → Replace: ""      # Result: "   Test"
3. Find: "Test" → Replace: ""      # Result: "   "

Option 2 (remove then convert):
1. Find: "test" → Replace: ""      # Result: " TEST Test"
2. Find: "TEST" → Replace: ""      # Result: "  Test"
3. Find: "Test" → Replace: ""      # Result: "  "

Plan order carefully!

Common Patterns

Remove extra whitespace:

1. Find: "\t" → Replace: " " (tabs to spaces)
2. Find: "  " → Replace: " " (double to single)
3. Find: "  " → Replace: " " (repeat to catch multiple)

URL encoding:

1. Find: " " → Replace: "%20"
2. Find: "!" → Replace: "%21"
3. Find: "#" → Replace: "%23"
4. Find: "$" → Replace: "%24"

Strip HTML tags:

1. Find: "<br>" → Replace: "\n"
2. Find: "<p>" → Replace: ""
3. Find: "</p>" → Replace: "\n\n"
4. Find: "<strong>" → Replace: ""
5. Find: "</strong>" → Replace: ""

Edge Cases

  1. Empty find string - Avoid, causes issues
  2. Circular replacements - Don't replace A→B then B→A
  3. Regex special characters - Automatically escaped
  4. Case sensitivity - Always case-sensitive

Troubleshooting

Replacement Not Working

Issue: Text not being replaced

Causes:

  • Find string doesn't match exactly (case, spacing)
  • Previous replacement modified text
  • Special characters not escaped properly

Solution:

# Check exact match
Code Task: return {debug: input.task_X001_field};

# Try with Formatter first
Formatter: UPPERCASE or LOWERCASE

Wrong Final Output

Issue: Unexpected result after replacements

Cause: Order of operations

Solution:

  • Review replacement order
  • Test incremental replacements
  • Use multiple Find Replace tasks if needed

Partial Replacements

Issue: Only some occurrences replaced

Cause: Previous replacement altered text

Example:

Input: "cat dog cat cat"

1. Find: "cat" → Replace: "dog"  # "dog dog dog dog"
2. Find: "dog" → Replace: "pet"  # "pet pet pet pet"

All "cat" became "pet" because they were first converted to "dog"

Solution: Be mindful of replacement chains

Special Characters Issues

Issue: Regex characters causing problems

Solution: Task automatically escapes these:

. * + ? ^ $ { } ( ) | [ ] \

No manual escaping needed.

Frequently Asked Questions

Is matching case-sensitive?

Yes, always case-sensitive. Use Formatter task to normalize case before Find Replace if needed.

Can I use regex patterns?

No, only literal string matching. For regex, use Pattern Regex task.

How many replacements can I add?

No hard limit. Keep practical (10-20 pairs typical).

Does it support multi-line text?

Yes, works with newlines (\n) and any text format.

Can I replace with empty string?

Yes, effectively removes the found text.

What if find string appears in replace string?

Second occurrence won't be replaced again (not recursive). Only original text is searched.

Can I use variables in find/replace strings?

Yes, both support variable replacement from previous tasks.


  • Formatter - Case conversion, trim, padding
  • Pattern Regex - Pattern-based extraction/validation
  • Variable - Store cleaned text for reuse
  • Code Task - Complex text transformations
  • Loop - Apply cleaning to multiple items