Generating random numbers or strings in HubSpot without Operations Hub Professional is possible. This guide explains how to do it using workflows and built-in fields. The method relies on using record IDs as a random source and branching logic in workflows to extract and interpret parts of those IDs.
This method works with any HubSpot subscription that includes workflows, such as Marketing Professional, Sales Professional, or Service Professional. You do not need Operations Hub. If you have Operations Hub, generating random numbers is easier using custom code or the formatter action, but this guide focuses on the workaround for accounts without it.
This video walks you through the steps below. Note that while this tutorial uses numbers, this logic could be used for letters or other characters as well.
How to Generate a Random Number or String without Operations Hub - Watch Video

What You Need
-
Access to HubSpot workflows
-
Ability to create custom and calculated properties
Supported property types for "begins with" and "ends with" conditions:
-
Single-line text
-
Email
-
Phone number
-
Dropdown select (text values only)
Step 1: Use the Record ID as a Random Source
Every HubSpot object (contacts, deals, companies, etc.) has a unique record ID. This ID is not truly random but is unpredictable enough to simulate random behavior. The Record ID is a long string of digits. The length and format may vary between object types.
Step 2: Copy the Record ID into a Single-Line Text Property
Create a custom property of type single-line text. Name it something like "Random Source." In a workflow, copy the Record ID into this property. This step is necessary because workflows do not allow branching logic for what the property begins with or ends with.
Step 3: Branch Based on the Last Digit
In the workflow, add an if/then branch. Use the "ends with" or "begins with" condition on the "Random Source" property. For example:
-
If ends with 0, set "Generated Random Digit" to 0
-
If ends with 1, set it to 1
-
Repeat for all digits through 9
Create a separate custom property (e.g., number or dropdown) to store the random digit. This gives you a single-digit pseudo-random number.
Step 4: Extract a Second Digit
If you need more than one random character, you can do that two. The second digital is the most straightforward, because we are using the nuts and bolts that you have already created. Instead of the pulling the last characters, create the same workflow but for the first characters or vice versa.
-
If begins with 0, set "Random Digit Two" to 0
-
If begins with 1, set it to 1
-
Repeat through 9
This gives you a second digit. Store it in a second property. You can leave them as separate digits and combine them later as needed.
Step 5: Use Associated Records for More Variability (Optional)
If you're working on an object record that always has another associated object record, you can pull in the record ID of an associated contact. In your workflow:
-
Wait for a contact to be associated with the deal
-
Copy the contact's Record ID into another single-line text property
-
Apply the same "begins with" and "ends with" logic as before
Step 6: Use a Calculated Property (Optional)
Alternatively or in addition to the above, create a calculated property using existing record data. Use static numbers, timestamps, or other properties to create a formula along with math. Then, copy the result into a single-line text property and apply the same "begins with" or "ends with" logic in a new workflow.
Summary
-
Use the built-in Record ID as a source of randomness
-
Copy the Record ID into a single-line text property
-
Use workflow branches based on what the text begins with or ends with
-
Store the result in a custom property
-
Repeat with calculated properties or associated records for additional characters
Conclusion
This process allows you to generate simple random-like values in HubSpot without Operations Hub. It is not as clean or scalable as using a custom code action, but it works with basic HubSpot workflow tools. Use this method for basic randomness needs such as routing, testing, or assigning values across records.
Once you have your random characters, you can populate your final custom property concatenating them through a workflow or calculated property. I would typically suggest using workflow, because your technical limit for number of worklows is much higher than the number of calculated properties that you can have in your portal.
If you want to automate or scale beyond this, consider upgrading to Operations Hub Professional or using an external tool through an API integration. If you would like help in determining whether Operations Hub is worth it, feel free to schedule a call from the button below.