Hey Operations Hub community! ![]()
We’ve written a “Custom Code” Action we’d like to share that can help you generate short, unique IDs directly within your HubSpot workflows. This can add a layer of unique identification to your data without needing to get bogged down in complex coding.
Why Use Unique, Short IDs?
Think of these IDs as custom labels for your data. They’re perfect for:
- Keeping Track of Customer Data: Easily identify and manage specific records within your customer data, making analysis more accurate.
- Streamlining Processes: Create short tracking codes to monitor and track your customer data within your business processes.
- Connecting HubSpot to Other Tools: If you’re syncing data between HubSpot and other apps, these IDs act as a reliable link, ensuring everything stays organized.
- General data organization: If you have any need for a unique identifier in your workflows, this tool can help.
How Does It Work?
We’ve written a small piece of code that generates 8-character, unique IDs. It’s designed to be used directly inside HubSpot’s workflow actions, so you don’t need to be a coding expert.
Here’s How to Add It to Your Workflow:
- Get the Code: You can find the code here: hubspot_short_uuid_generator
- Add a “Custom Code” Action: In your HubSpot workflow, look for the “Custom Code” action and add it.
- Copy and Paste: Copy the code from the GitHub link and paste it into the “Custom Code” action.
- Tell HubSpot Where to Store the ID: You’ll need to tell HubSpot where you want to save the generated ID (e.g., a custom property).
- Use the ID in Your Workflow: Now, you can use that unique ID in other steps of your workflow.
Example Workflow use case:
We recently faced a situation where we needed to share and sync customer data across multiple applications. To ensure consistent customer identification and the ability to update the data across these systems, we required a reliable, cross-domain ID.
We implemented a workflow that generates a unique 8-character ID whenever a new customer is created in HubSpot. This ID is then pushed to all other applications. This ensures that when a customer interacts with any of the applications, we can easily trace their journey and update their information across all platforms. This solution helped us achieve a unified view of our customer data and streamline our data management.
Why 8 Characters?
8 characters is the sweet spot. It’s short enough that you can actually remember it, which is incredibly helpful when you’re working with data across different systems. This human-friendly length makes it easier to reference and work with, unlike those long, unwieldy standard UUIDs.
Try It Out!
This code is free to use. Give it a try and let us know how you’re using it! We welcome and appreciate all feedback and contributions.




