CRM

SandrineMayzou
Contributor | Platinum Partner
Contributor | Platinum Partner

Custom Unique IDs not supported by Forms

SOLVE

Dearest experts, how can I find my way around to associate a Contact and other object (ie Company) in Contact Form when our customer is strongly BTOB focused and uses custom Company IDs to handle incoming requests. We do not want each request to create duplicates and yet, the company has to be associated to the Contact (if new/created) exactly like the solution would operate for imports of associated objects. I assume this has similar impacts on those who wish to associate ticketing request to Companies or Orders etc...  Note : For Companies, Domain isn't a sufficient ID at all. This is a BIG struggle for me, how do you handle that?

0 Upvotes
3 Accepted solutions
Jigar_Thakker
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Custom Unique IDs not supported by Forms

SOLVE

Hi @SandrineMayzou,

 

I hope I understood this correctly. The company object has a custom unique ID property. When a contact submits a form, they add an ID in a form field, and you want them to be associated with the company that has the exact ID. If the company with that exact ID doesn’t exist, it should create a new company with the submitted new ID.

 

If this is the requirement, the solution here would be association via workflow. 

 

Step-by-Step:

 

First, create a contact and company property, single-line test or number, make the company’s property Unique (i.e., toggle ON the Require Unique Values), do not make the contact’s property unique, because many contacts can have the same company IDs.

 

You can keep different names, but I would suggest the same names for both. Let's assume “Company UID”.

 

On the form, we would use the Contact object’s “Company UID”.


Workflow:

 

  • Automation > Workflows, create a Contact-based workflow, and enroll contacts when the “Company UID” is known (or the form submission).

Jigar_Thakker_0-1755720081162.png

 

  • Add action Create associations (under CRM) with Object to associate > Company > Matching property values, map Contact’s “Company UID” to Company’s “Company UID”. If you choose label, it should have 1 to Many association limit b/w Company to Contacts.

Jigar_Thakker_1-1755720149696.png

 

  • Add an if/then branch:
    • If the contact has an associated company with a “Company UID” known, exit the workflow (because checking with other properties like record ID or domain would also unenroll/exit other contacts as well). 
    • If the contact still has no associated company (none met branch), add Create record > Company; set Company name (mendatory, you can set it to the submitted ID) > Add more properties > Copy a property to a company property to fill the company’s Company “UID”. Same case for labels as above. By default, the newly created company is automatically associated with the enrolled contact.

Jigar_Thakker_2-1755720372771.png

 

 

 

<< Branch 1 (exit the workflow).

 

 

 

 

 

 

 

 

Jigar_Thakker_3-1755720538125.pngJigar_Thakker_4-1755720595434.png

 

 

First, test the workflow with a sample/testing form (submit test emails for guaranteed contact creation). 

 

Having a little delay between steps in the workflow can help, but not required.

 

Let me know if clarification is required at any step, OR if this isn’t the exact requirement, I’ll figure out another workaround for this.

 

If this helps, feel free to mark it as the solution ✔️ and give it an upvote 👍 !

View solution in original post

JMcLaren78
Solution
Member

Custom Unique IDs not supported by Forms

SOLVE

The first thing I would try is a simple url parameter and hidden form field.  There's a lot of different ways to accomplish what you are looking for depending on how much control you have of the path to the form. We have even done this using dynamic company pages and pulling the company id from the page url and putting it in the form.  

View solution in original post

0 Upvotes
Jigar_Thakker
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Custom Unique IDs not supported by Forms

SOLVE

Hey, Great Minds Think Alike 😅!

 

Yes, I would pick contact property "company name" and paste it in the company property while creating the new company record in the same workflow.

 

Same behaviour of import and forms for associations (with custom UID) makes sense. I think we know what to do: https://community.hubspot.com/t5/forums/postpage/board-id/HubSpot_Ideas/search-before-post-mode/true

View solution in original post

4 Replies 4
JMcLaren78
Solution
Member

Custom Unique IDs not supported by Forms

SOLVE

The first thing I would try is a simple url parameter and hidden form field.  There's a lot of different ways to accomplish what you are looking for depending on how much control you have of the path to the form. We have even done this using dynamic company pages and pulling the company id from the page url and putting it in the form.  

0 Upvotes
Jigar_Thakker
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Custom Unique IDs not supported by Forms

SOLVE

Hi @SandrineMayzou,

 

I hope I understood this correctly. The company object has a custom unique ID property. When a contact submits a form, they add an ID in a form field, and you want them to be associated with the company that has the exact ID. If the company with that exact ID doesn’t exist, it should create a new company with the submitted new ID.

 

If this is the requirement, the solution here would be association via workflow. 

 

Step-by-Step:

 

First, create a contact and company property, single-line test or number, make the company’s property Unique (i.e., toggle ON the Require Unique Values), do not make the contact’s property unique, because many contacts can have the same company IDs.

 

You can keep different names, but I would suggest the same names for both. Let's assume “Company UID”.

 

On the form, we would use the Contact object’s “Company UID”.


Workflow:

 

  • Automation > Workflows, create a Contact-based workflow, and enroll contacts when the “Company UID” is known (or the form submission).

Jigar_Thakker_0-1755720081162.png

 

  • Add action Create associations (under CRM) with Object to associate > Company > Matching property values, map Contact’s “Company UID” to Company’s “Company UID”. If you choose label, it should have 1 to Many association limit b/w Company to Contacts.

Jigar_Thakker_1-1755720149696.png

 

  • Add an if/then branch:
    • If the contact has an associated company with a “Company UID” known, exit the workflow (because checking with other properties like record ID or domain would also unenroll/exit other contacts as well). 
    • If the contact still has no associated company (none met branch), add Create record > Company; set Company name (mendatory, you can set it to the submitted ID) > Add more properties > Copy a property to a company property to fill the company’s Company “UID”. Same case for labels as above. By default, the newly created company is automatically associated with the enrolled contact.

Jigar_Thakker_2-1755720372771.png

 

 

 

<< Branch 1 (exit the workflow).

 

 

 

 

 

 

 

 

Jigar_Thakker_3-1755720538125.pngJigar_Thakker_4-1755720595434.png

 

 

First, test the workflow with a sample/testing form (submit test emails for guaranteed contact creation). 

 

Having a little delay between steps in the workflow can help, but not required.

 

Let me know if clarification is required at any step, OR if this isn’t the exact requirement, I’ll figure out another workaround for this.

 

If this helps, feel free to mark it as the solution ✔️ and give it an upvote 👍 !

SandrineMayzou
Contributor | Platinum Partner
Contributor | Platinum Partner

Custom Unique IDs not supported by Forms

SOLVE

Hello @Jigar_Thakker 

 

Thank you again! I actually had done that! but I thought it was quite a way around! I am very comforted  that you would come to the same data flow to make this work! The tricky part is htat for the scenario where the Company doesn't exist yet, I ask for the Company object name (to create and associate it) and this creates duplicates, right? Do you then go around it again by using the Contact property Company name and then an additional workflow to create and associate it?
I would still suggest that HubSpot future dev would simply align custom unique ID treatment for Forms to their imports behaviour.
Would you use the same way around for all objects associations? ie Tickets submitted from a company regarding an order (with Order ID)? 

0 Upvotes
Jigar_Thakker
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Custom Unique IDs not supported by Forms

SOLVE

Hey, Great Minds Think Alike 😅!

 

Yes, I would pick contact property "company name" and paste it in the company property while creating the new company record in the same workflow.

 

Same behaviour of import and forms for associations (with custom UID) makes sense. I think we know what to do: https://community.hubspot.com/t5/forums/postpage/board-id/HubSpot_Ideas/search-before-post-mode/true