How to generate a unique field in HubSpot Forms?


Is it possible to have HubSpot Auto Generate a unique number per form submission? Ideally, I would like to create a field which can be used across multiple forms which generates a unique number across all submissions. This will be used to track the form in HubSpot and Salesforce.


Hi @JaronEI

This isn’t something that we currently support. It’s possible to accomplish this with an external platform that could keep track of the unique number, using a combination of forms, workflows, and the Contacts API, but it’s not something that forms or workflows could do natively.

Can you tell me more about what you’d be doing with that unique id?


This is part of an opportunity registration process for partners. Would be used to track the opportunity through both HubSpot and Salesforce


Hi @JaronEI,

You could use JavaScript to generate a unique number for that form submission, either by generating a timestamp or some other unique identifier and have that populate into a hidden form field.



This would be AWESOME for using unique codes for referral generation rather than having to export the contacts, add a unique code in excel and then re-import them.

I’m trying to create an ongoing referral generation campaign that can easily identify the referrer by the unique code they have that will be part of their own link to share our business. Right now I am going to have to do this in short term projects.

I’m also trying to find a way to automatically notify the hubspot owner of a referree when a referral has been generated by them. This isn’t possible from what I have been able to research so far.