OA
OpsAgent

Find And Replace

Last updated 3 weeks ago

The Find And Replace workflow action searches for specific text or numbers within a HubSpot property value and replaces them with new text. It works on contacts, companies, deals, and tickets.

How It Works

Add the Find And Replace action to any HubSpot workflow that runs on contacts, companies, deals, or tickets. When a record reaches this step, the app reads the property you selected, performs the find-and-replace operation, and returns the updated value along with information about whether the operation succeeded.

Action Inputs

When you add the action to your workflow, you'll configure the following fields:

Field Required Description
Input Text Yes The text to search in
Find String Yes The string to find
Replace String Yes The replacement string
Case Sensitive No Whether to match case (default: false)
Replace All No Replace all occurrences or just first (default: true)

Field Details

Case Sensitive

  • Unchecked (default) - "usa" matches "USA", "Usa", "usa", and any other casing
  • Checked - only an exact case match is found, so "usa" would not match "USA"

Replace All

  • Checked (default) - every occurrence of the search text in the property value is replaced
  • Unchecked - only the first occurrence is replaced

Action Outputs

After the action runs, the following output values are available for use in subsequent workflow steps:

Output Type Description
Result Text Text The updated property value after all replacements have been made
Replacement Count Number The number of replacements that were made. Use this to branch on whether any matches were found.
Success Yes/No Whether the operation completed without errors
Error Message Text A description of what went wrong, if anything

Tip: To learn how to use these output values in later workflow actions (e.g., copy to a property, use in branching logic), see Using workflow action outputs in the HubSpot Knowledge Base.

Usage Examples

Standardize Country Names

Replace abbreviated country names with full names across your contact database.

  • Input Text: Country property
  • Find String: US
  • Replace String: United States
  • Case Sensitive: Unchecked
  • Replace All: Checked

Clean Phone Number Formatting

Strip unwanted characters from phone numbers by running multiple Find And Replace steps in sequence.

  • Step 1: Find (, replace with empty
  • Step 2: Find ), replace with empty
  • Step 3: Find -, replace with empty

After all three steps, (555) 123-4567 becomes 555 1234567.

Update Product Code Prefixes

When migrating to a new product naming convention, update prefixes across deal line items.

  • Input Text: Product Name property
  • Find String: LEGACY-
  • Replace String: NEW-
  • Case Sensitive: Checked
  • Replace All: Unchecked (only change the prefix, not any other occurrence)

Fix Spelling Inconsistencies

Ensure consistent spelling across your CRM records.

  • Input Text: Description property
  • Find String: cancelled
  • Replace String: canceled
  • Case Sensitive: Unchecked
  • Replace All: Checked

Remove Unwanted Text

Delete specific text from a property by leaving the replacement empty.

  • Input Text: Notes property
  • Find String: [DRAFT]
  • Replace String: (leave empty)
  • Case Sensitive: Unchecked
  • Replace All: Checked

This removes every occurrence of "[DRAFT]" from the notes.

Tips

  • Test on a small set first. Use enrollment criteria to limit your workflow to a few test records before rolling it out widely. Check the updated property values to make sure the results are what you expect.
  • Chain multiple actions. You can add several Find And Replace steps in a row to make multiple different replacements on the same record.
  • Use case sensitivity carefully. If your data has inconsistent casing (which is common with manual entry), leave case-sensitive unchecked so all variations are caught.
  • Check the replacement count. Branch your workflow on whether any replacements were actually made. This lets you skip follow-up steps when the property didn't contain the text you were looking for.
  • Empty replacement is removal. Leaving the Replace String empty effectively deletes the matched text, which is useful for stripping prefixes, suffixes, or unwanted characters.
  • Number properties work too. If a number property contains the text you're searching for (as a string representation), Find and Replace will process it the same way.
Previous
Use Cases