Logo
Home
Resources

Product

Custom Workflow

Resources

Blog
Youtube
Template
Home
>
Product
>
Template Top
>
detail

How to Automatically Replace Text in HubSpot Workflows (Using Custome Workflow Starter)

This article explains the purpose, use cases, and operational steps for the "Text Replacement Action" feature, part of the third-party HubSpot app "Custome Workflow Starter."

Demo Video

Over view
Code

Detail

Purpose

The primary purpose of this workflow action is to automatically find specified text within a string (such as a property value) and replace it with different text.

For example, if a "Notes" property contains "ABC-001," you can replace "001" with "002" to get the result "ABC-002." The replaced string is returned as an "action output" in the workflow, allowing you to save it to a different (or the same) property in a subsequent action.

Use Cases

This feature is useful for automating data formatting, normalization, and the updating of specific information.

  • Data Normalization: Standardizing company name suffixes, such as replacing various inputs like "Inc." or "(Corp.)" with the full "Incorporated."
  • Removing Unwanted Characters: Finding and replacing hyphens "-" in phone numbers submitted via forms with an empty string (effectively deleting them).
  • Updating Information: Bulk replacing old product codes or campaign names with new ones within memo fields or descriptions.
  • Dynamic Text Generation: Creating custom messages by replacing parts of a base template string with other property values.

Setup and Execution Steps (As seen in the video)

The video demonstrates a flow where the text "112" within a string is replaced with "204," and the result is then saved to another property.

Step 1: Check Workflow and Trigger

  • The process begins in the workflow editor.
  • The trigger (enrollment criteria) is set to activate when the "Event Date" property value is changed.

Step 2: Add the Custom Action

  • Click the "+" icon in the workflow to add a new action.
  • From the action selection panel, choose "Custome Workflow Starter" from the "Integrated apps" section.

Step 3: Select the Action

  • From the list of custom actions that appears, select "Text Replacement Action."

Step 4: Configure the Replacement Rules

  • The configuration screen for "Text Replacement Action" opens.
  • Base Text: Enter the source string that will be searched. You can use HubSpot property tokens to dynamically set this value from a contact or company property.
  • Search Text: Enter the string you want to find within the Base Text (e.g., "112").
  • Replacement Text: Enter the new string that will replace the Search Text (e.g., "204").
  • After configuring, click "Save."

Step 5: Use the Replaced Result (Action Output)

  • The "Text Replacement Action" only outputs the result of the replacement. To save this result to a property, a subsequent action is required.
  • In the workflow, click the "+" icon after the replacement action and add a standard action like "Set property value" or "Edit record."
  • Select the property you want to save the result to (in the video, this is "Message").
  • In the value input field, do not use a property token. Instead, select "Action outputs."
  • Expand the "1. Text Replacement Action" (the step number may vary) and select the Replaced Text output token.
  • This will set the "replaced string" as the value for your chosen property.

Step 6: Verify the Final Result

  • Activate the workflow ("Workflow is On") and trigger it.
  • Go to the "Enrollment history" tab and open the history details for the executed contact (test@gmail.com).
  • In the "Action outputs" for the "1. Text Replacement Action," you can see the VALUE is test204. (This indicates the original value was "test112," and "112" was replaced with "204".)
  • The subsequent "2. Edit record" action also succeeded, confirming that this test204 value was correctly saved to the property.

‍

Source Code

HTML
CSS
Javascript

FAQ

Is this "Text Replacement Action" a standard HubSpot feature?

No, it is not a standard feature. The feature explained in this article is a custom action that becomes available by installing a third-party app called "Custome Workflow Starter" in HubSpot.

Can I use this action to remove all hyphens (-) from a phone number?

Yes, you can. In the Step 4 settings, by specifying the character you want to remove (in this case, the hyphen -) in the "Search Text" field and leaving the "Replacement Text" field empty (blank), you can get a result where the hyphens are removed from the original text (e.g., 090-1234-5678 → 09012345678).

Does running this action automatically update the original property (the one specified in "Base Text")?

No, it does not update automatically. As explained in Step 5, this action only outputs the replaced string as "Replaced Text." If you want to update the original property's value, you must add HubSpot's standard "Set property value" action after this custom action. In that action, you would select the original property as the "Property to set" and then specify this action's output (Replaced Text) as the "Value to set."

Search

Search more

Related Template

Need Customization?

We can customize this sample to match your specific business requirements.

Book Free Consultation

Got a quick dev request?

Put it on Trello!Need a fix for HubSpot, CMS, or GAS? Post it on Trello.

Development Requests Here

GAS Library: Automated Blog Post NG Word Checking with AI (Gemini/OpenAI)

HubSpot Custom Workflow Guide: How to Find a Contact's "Most Recent Campaign"

HubSpot Custom Workflow Guide: How to "Search" for Products and Get Price/SKU Data

GAS Library Guide: How to Automatically Check for Broken Links in Google Sheets

HubSpot Custom Workflow Guide: How to Auto-Search and Recommend Marketing Events

Company Info
Name : SweetsVillage .Inc
CEO :
‍
Tomoo Motoyama

HomeTemplateCustomWorkflow
Terms & ConditionsPrivacy PolicyContact us

Copyright ©SweetsVillage .Inc

Back To Top Image