APIs & Integrations

Marsharks
Contributor

How to sync Company and Contacts with existing system

SOLVE

We currently have a Contact database and would like to export that data into Hubspot to start a fresh system.  From there, we would like to import the new Company and new Contacts into out existing Contact database.  We need to keep our existing Contacts for audit purposes.

 

We already have a Contact ID column that is not auto increment, so I could theoretically use the VID returned by the Contact API and insert that value into the Contact ID column, however, I would need to be able to control where the VID starts to avoid a duplicate ID/collision. 

 

Another solution would be to add a new column to my existing database that would store the VID from Hubspot.

 

Which solution would be recommended?  I would prefer to be able to set the starting point for the VID in Contacts and the other ID in Company to avoid collisions and not have to change my DB schema. I also don't want a difficult way of doing that.  In SQL Server one could set the starting point for an identity seed and in systems where a sequence number is generated (MS Dynamics) one could set the starting number as well very easily.

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

How to sync Company and Contacts with existing system

SOLVE

Hi @Marsharks,

 

Thanks for the further clarification. That is right, currently we wouldn't be able to set the contact vid within HubSpot, the number will be randomly generated based on the number of contacts/companies you've in your portal.

 

Therefore, the next best approach is probably to create a reference ID to contain the VID, or another way is: when you're looping through, cross check the contact vid with the old contactid and if it matches, set a new number to it. 

View solution in original post

0 Upvotes
5 Replies 5
WendyGoh
HubSpot Employee
HubSpot Employee

How to sync Company and Contacts with existing system

SOLVE

Hi @Marsharks,

 

I hope all is well with you 😃

 

Just to make sure that I'm understanding it correctly, let me it out here:

  • Within your HubSpot app, you have existing contacts and companies records and in your own contact database, you also have existing contacts and companies records
  • You'd like to import the records that you've in your own contact database into HubSpot
  • So that you can export it all at one go
  • You'd then like to import the exported file into your own contact database
  • For the new contacts (those that are in your HubSpot app), you'd like to store the contact data as well as the vid in the contact id column of your own database system as the existing contacts and companies contacts in your own contact database already has the contact ID

Utimately, that's your end goal, am I understanding it correctly?

 

If so, when fetching and storing the contact data such as email, name etc to your own contact database, can you also grab and store the vid? When looking at the HubSpot get all contacts API; each contact record will return as one full json stored in an array, this means that you can grab the contact information together with the vid when looping through the array.

 

Let me know if I'm totally off the page, I'd be happy to discuss this further with you!

Marsharks
Contributor

How to sync Company and Contacts with existing system

SOLVE

Yes, that is a close enough understanding of the issue.  At this time, we do not have any contacts in the Hubspot App though.  We want to export a subset of existing Contacts into Hubspot, then bring them back into our system using the VID assigned.

 

I agree I can get all the contacts and loop through them.  I think the problem would arise if I get a random VID, say 65432 because I have a ContactID already with that number.  

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

How to sync Company and Contacts with existing system

SOLVE

Hi @Marsharks,

 

Gotcha. In this case, I'm thinking would it be best for you to clear out the contactID column to prevent any conflict with the new ID column which will be populated via the contact VID? This is because, ultimately I believe your team would only be keeping one column ID as the unique identifier.

 

Let me know what you think!

0 Upvotes
Marsharks
Contributor

How to sync Company and Contacts with existing system

SOLVE

We need to keep the old ContactID for historical purposes.  It is the Primary Key of that table, so it cannot be null.  IF we cannot set the starting point for the VID, I think the best solution is to create a referenceID column to contain the VID.

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

How to sync Company and Contacts with existing system

SOLVE

Hi @Marsharks,

 

Thanks for the further clarification. That is right, currently we wouldn't be able to set the contact vid within HubSpot, the number will be randomly generated based on the number of contacts/companies you've in your portal.

 

Therefore, the next best approach is probably to create a reference ID to contain the VID, or another way is: when you're looping through, cross check the contact vid with the old contactid and if it matches, set a new number to it. 

0 Upvotes