Anonymize String
Last updated 3 weeks ago
The Anonymize String workflow action protects sensitive text data by masking, hashing, randomizing, or redacting string values. Use it to obscure names, email addresses, identifiers, and other personal information stored in your HubSpot CRM properties.
How It Works
Add the Anonymize String action to any contact, company, deal, or ticket workflow in HubSpot. When a record reaches this step, the app reads a text value from the CRM property you selected, applies your chosen anonymization method, and returns the anonymized string so your workflow can store or act on it.
Action Inputs
When you add this action to your workflow, you'll configure the following fields:
| Field | Required | Description |
|---|---|---|
| String to Anonymize | Yes | Pick a CRM text property from the enrolled record. This is the string value that will be anonymized. |
| Anonymization Type | No | Choose how the string should be anonymized. Options: Mask All -- replaces every character with the mask character (e.g., "John" becomes "****"); Mask Partial -- keeps the first and last characters visible and masks the rest (e.g., "John" becomes "J**n"); Hash (SHA256) -- converts the string into a fixed-length hash that cannot be reversed; Random Characters -- replaces the string with random alphanumeric characters; Redact -- replaces the entire string with "[REDACTED]". |
| Mask Character | No | The character used for masking. Defaults to * if left blank. |
| Preserve Length | No | When enabled, the anonymized string will have the same number of characters as the original. Applies to masking and random character methods. |
Action Outputs
After the action runs, the following values are available for use in later workflow actions (e.g., copy to property, branching):
| Output | Type | Description |
|---|---|---|
| Anonymized String | Text | The text value after anonymization has been applied |
| Original Length | Number | The character count of the original string before anonymization |
| Success | Yes/No | Whether the anonymization completed without errors |
| Error Message | Text | If something went wrong, this contains a description of the problem |
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
Masking Contact Names for Privacy in HubSpot
When a contact requests partial anonymization, you can mask their name while keeping enough characters visible to confirm identity during support interactions.
- Trigger a contact-based workflow when a contact submits a privacy request form
- Add the Anonymize String action and select the First Name property
- Set the Anonymization Type to Mask Partial and enable Preserve Length
- Copy the Anonymized String back to the First Name property -- "Jonathan" becomes "J******n"
- Repeat with another Anonymize String action for the Last Name property
Hashing Email Addresses for Deduplication in HubSpot
When you need to match records across systems without exposing actual email addresses, hashing produces a consistent identifier that can be compared without revealing the original value.
- Trigger a contact-based workflow when a contact is created or updated
- Add the Anonymize String action and select the Email property
- Set the Anonymization Type to Hash (SHA256)
- Store the Anonymized String in a custom single-line text property like "Email Hash"
- Use this hash value to match records in external systems without sharing raw email addresses
Redacting Sensitive Notes Before Data Export from HubSpot
Before exporting CRM data to external tools or shared reports, you may need to completely redact text fields that contain confidential information.
- Trigger a deal-based workflow when a deal is added to a list for export
- Add the Anonymize String action and select the custom property containing sensitive notes
- Set the Anonymization Type to Redact
- The property value is replaced with "[REDACTED]", ensuring no sensitive text leaves your HubSpot portal
Tips
- Mask Partial is useful for customer-facing contexts. It shows enough of the original value (first and last characters) to confirm a match while hiding the rest, similar to how credit card numbers are displayed.
- Hash (SHA256) is deterministic. The same input always produces the same hash, making it useful for deduplication and cross-system matching. However, the hash cannot be reversed to recover the original value.
- Redact is the safest option for full removal. When you need to completely erase a text value and do not need to preserve any information about the original, Redact replaces it with a standard "[REDACTED]" label.
- Use Preserve Length when format matters. Enabling this option ensures the anonymized value has the same character count as the original, which can be important when downstream systems or integrations expect a specific field length.
- Combine with other Data Anonymizer actions. You can chain Anonymize String with Anonymize Date and Anonymize Number actions in the same workflow to anonymize an entire record in a single pass.
Thank you for your feedback!
Your input helps us improve our documentation.
Was this page helpful?
Great! What worked best for you? How can we improve our product?
- Previous
- Anonymizenumber Action
- Next
- Settings