Purpose
The primary purpose of this workflow action is to compare two text strings (which can be property values or fixed text) within a workflow using specific logic.
While HubSpot's standard "IF/THEN branch" feature also allows for condition-based comparisons, this custom action returns the comparison result as a data output: "yes" or "no." This output value can then be saved to a different property in a subsequent action or used as a condition for another branch, enabling more advanced and flexible automation logic.
Use Cases
This feature is useful when you need to make a specific judgment based on a property's value.
- Keyword Checking: Determine if a free-text field (e.g., "Contact Message") contains specific keywords like "Urgent" or "Quote."
- Data Validation: Check if an entered property conforms to a specific format (e.g., if a "Member ID" starts with "A-").
- Specific Value Matching: Determine if a property's value is equal to a specific, exact value.
- Saving Results: Save the comparison result (yes/no) to another custom property (e.g., "Keyword Flag"), which can then be used for list segmentation, reporting, or as a trigger for another workflow.
Setup and Execution Steps (As seen in the video)
The video shows the process of setting up the "Comparison Action" in a workflow and confirming its execution, which returns a "yes" result.
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.
- From the list of custom actions that appears, select "Comparison Action."
Step 3: Configure the Comparison Logic
- The configuration screen for "Comparison Action" opens.
- Comparison Logic: Select how the strings will be compared. The video shows options including:
is equal tois not equal tocontainsdoes not containstarts withends with
Step 4: Set the Strings to Compare
- Source String: Set the base value for the comparison. The video indicates that you can use tokens, such as contact properties, here.
- Comparison String: Set the value to compare against. You can enter fixed text (e.g., "Urgent") or use another property token.
- Once configured, click "Save."
Step 5: Activate the Workflow and Confirm Execution
- The "1. String Comparison Action" is added to the workflow.
- Activate the workflow (the video implies switching the "Workflow is OFF" toggle to "ON") and perform the action that meets the trigger criteria.
- Navigate to the "Enrollment history" tab to confirm that the "test@gmail.com" contact has executed the workflow.
Step 6: Verify the Final Result
- Check the "Event details" of the execution history.
- In the "Action outputs" section, the value
yes is returned as the results. - This means the configured comparison logic (e.g., "contains 'Urgent'") was met (True). If the condition had not been met, this would have returned
no.
By using the "Comparison Action," you can compare text strings, get a simple "yes/no" data output, and leverage that result in subsequent workflow actions.