Hola! ¡Tenemos nuestra Comunidad en Español!

Re: Copy contact properties to Deal?

Occasional Contributor

Hi @ivorykeys87 , @appleboxx  and everyone else -

 

Happy to share what I've designed for my client in the hopes it helps you.

 

Objective: copy contact properties into newly created deal

 

Notes:

  • Given that HubSpot does not natively support this feature, the below solution requires some minor custom code (which I've shared) and one external service provider (Zapier) to connect all the dots. You can technically integrate without Zapier, but that requires more engineering efforts and is outside the scope of what I'm summarizing below since I don't think that's what either of you is looking for.

 

  • I've identified two ways of successfully copying contact properties into deal properties. Depending on how important speed is for your application (ie. do you need the deal properties updated instantly when deal is created, or are you okay waiting upwards of 5 to 15 minutes) you can decide which approach is right for you.

 

Option 1 (not instant):

 

  • Within Zapier, click "Make a Zap!" and select HubSpot CRM as Trigger app

 

  • Next, select "New Deal" as the trigger (this will run either every 15 or 5 min depending on your Zapier account)

 

  • If it's not already, connect your correct HubSpot account on the next page by entering your username / password in the popup after selecting "Connect Account"

 

  • After connecting your HubSpot account, make sure you've created a recent deal before testing the connection in the next step within Zapier

 

  • Assuming you've created a new deal, Zapier will identify the deal. In the response object, you will see "associatedVids" property. Provided you have associated the proper contact with deal, this is the HubSpot contact ID. We will use it in next request.

screenshot-zapier.com-2018-01-09-02-06-57.png

  • We will now use this returned 'associatedVids' value to make a follow up call to HubSpot to retrieve the desired contact property values we want to copy into deal

 

  • In the "Action" step within Zapier, select "Code" option (note: do not select "HubSpot CRM" and "Find Contact" because it will force you to search by name or email address - neither of these values is included with Deal properties by default and would add complexity to your internal (human) system process when creating deals).

 

  • After selecting "Code" select "Run Python" (don't worry if you're not an engineer, I'll provide code below)

 

 

  • Be sure to update the above request with your own HubSpot API key. Once you've done so, run the test and you should see the test was successful provided your API key is entered correctly.

 

  • Now that we have our Contact Properties being returned, our final step is to setup a second Action within Zapier to update an existing deal with these property values.

 

  • On the left side of Zapier screen, select the "+" button underneath the first action we just created. Select "HubSpot CRM" as the App and "Update Deal" as the Action.

 

  • Next, select the HubSpot account that you recently added that has the deal. Next to the Deal parameter, select the downward arrow, scroll to the bottom and select "Use Custom Value"

screenshot-zapier.com-2018-01-04-10-04-14(1).png

 

 

  • A new field will appear directly below called "Custom Value for Deal Deal ID". Select the + arrow on the right of this field and select "Deal ID" which will be listed under the results from Step 1

 

  • Next, identify the Deal Properties you want to automatically update to include values from Contact Properties. Select the "+" icon on the right side of these input fields and locate the returned corresponding Contact Property values which will be listed underneath the "2: Run Python" header in dropdown. This simple process maps the returned values in our Python request to the Deal Property fields when we make the API call to HubSpot.

 

  • When you're done mapping the Deal Properties you'd like updated, scroll to the bottom and select "Continue"

 

  • On the next screen, Zapier will show you the sample values they will be using to make test call to HubSpot CRM. If everything looks correct and no errors are reported, run the test. If everything is setup properly, this test will update the Deal in HubSpot. Check HubSpot to confirm your deal properties are updated.

 

  • Last, turn on your Zap! By default, it will run every 15 minutes unless you upgrade your Zapier account and it will then run every 5 minutes.

 

Please let me know if updating Deal Properties instantly when Deal is created is important for your use cases and I will then document how you can make that happen. It will require slightly more work, on your end (and mine to document), but happy to help. And it won't require updating your Zapier account for just this purpose.

 

Cheers,

 

Erik

34 Replies
Occasional Contributor

Hey everyone -

 

I've identified a way to solve this issue for a client. If you're still looking for a solution, please reply and I'll take the time to document my work around.

 

Cheers,

 

Erik

Occasional Contributor

@ebog I would love to hear! Thanks for sharing!

Reply
0 Upvotes
New Contributor

Lets hear it man!

Reply
0 Upvotes
Occasional Contributor

Thanks @ebog!

If one of fields copied changes at a future date (e.g.Number of employees Field in Contact properties  changes from 200 to 300) , do you know if this zap will work to copy it to the associated field in the Deal properties?

 

If it does, will it work vice versa (Deal property -> Contact property)?

Thanks,

Svet

Reply
0 Upvotes
Occasional Contributor

Hey -

 

Deal property -> contact property can already be done within HubSpot workflows.

 

And while the example I gave will not update the field in the future should it change, it's easy to setup another Zap to trigger when the value in the field you've mentioned changes. So yes, it's possible and easy to setup.

 

Erik

Reply
0 Upvotes
Occasional Contributor

@ebog - It doesn't seem everyone has what you referred to. My workflows do not have the ability to copy a deal property into a contact property. 

 

Therefore, can we use your workaround to go in the opposite direction, deal > property? 

 

In my scenario, I'm trying to get specific deal properties (they happen to be dates) into contacts so we can send internal emails to people who need to know these specific date fields. You can't use deal properties as token in emails, so this is why we're looking to this workaround.

 

- Sam

Reply
0 Upvotes
Occasional Contributor

hey @Samanderson41 happy to help. what exactly are you referring to when you say others may not have the same functionality. hubspot does not support moving contact properties into deal or deal properties into contact natively. my solution uses outside resources to bring the systems together.

 

yes it is possible to pass date properties from deal into contact record. if you'd like you can email me directly and i can help you. erik@boomlabs.co

Reply
0 Upvotes
Occasional Contributor

@ebog - Actually, I think we my have worked it out! We use "New Deal in Stage" (for us, it could be new deal for others, because we're requiring specific dates at a specific stage). Your python code can be used, and then instead of updating a deal we update a contact.

 

Testing it now and waiting to see if it works...

Reply
0 Upvotes
Community Thought Leader

Hey @ebog, first of all thanks for your explanation. (above and beyond)

 

However, just gotta ask, what precisely do you mean by "Deal property -> contact property can already be done within HubSpot workflows."?

 

Where are you finding a way to copy deal properties to contact properties within HubSpot workflows please?

 

Thanks in advance.

 

UPDATE:

- see [Now Live] Deal-based and Ticket-based Workflows (31-Aug-2018)

 

Best,

Frank

HubSpot Smart Pages

hubspot-solutions-signature-pricing-options-v01.png

Reply
0 Upvotes
Occasional Contributor

I just a found an automatic and fast way to copý properties form contacts to deals but this only be done if the deal is created from a workflow.  When you select the "Create Deal" action in a workflow, it lets you copy the properties from the contact.

 

 

Reply
0 Upvotes
Highlighted
Occasional Contributor

For some reason it’s giving me an "error" once I replace the api key with ours. I can confirm I’ve entered the api as below with our API replacing where the blank line is. It pulled in the deal in the first step properly but then not sure what's wrong with the API error. Any feedback?

 

url = 'https://api.hubapi.com/contacts/v1/contact/vid/%s/profile?hapikey=[_______________]' % (input_data['vid'])


response = requests.get(url)
return response.json()

Reply
0 Upvotes
Occasional Contributor

Hey @CoachAaronCCR did you make sure to remove the brackets around your API key when you paste it in? Sorry for delay writing back, Hubspot kept deleting my posts so I gave up. Hope this one reaches you. Happy to help further.

Reply
0 Upvotes
Regular Contributor | Gold Partner

Erik, just used your Zapier and code for a client need and worked great, thanks... if you are willing to share the adjustments for contact phone number changes, would love it as I couldn't get that one on my own...  Great suggestion!

Reply
0 Upvotes
Occasional Contributor

hey @Trumeter glad it worked. can you please provide more details around what you're looking to achieve. I'm not sure I follow when you reference changes to phone number.

 

are you saying if the phone number changes with contact record, you want it to be updated within the deal record? yes, this is possible. it's also possible to update contact record should the deal record phone number change. please let me know which you're looking for guidance on implementing.

Reply
0 Upvotes
Regular Contributor | Gold Partner

Hey @ebog, yes I am looking for the first case you described...

Reply
0 Upvotes
New Contributor

Thanks! I am trying it.

Reply
0 Upvotes
New Contributor

@ebog

These instructions were very helpful.  Is it possible to do this with Company properties as well?  How would the api link change to accomodate that?

 

Thanks

Reply
0 Upvotes
New Contributor

@ebog Thanks for the code. It really helped me a lot. I was trying to do a similar set up for seaching companies using domain name in hubspot using zapier. But ended  up getting an error in the code.

 

d = input_data['domain']

url = 'https://api.hubapi.com/companies/v2/domains/%d/companies?hapikey=xxxxx'

data = {
"limit": 2,
"requestOptions": {
"properties": [
"domain",
"createdate",
"name",
"hs_lastmodifieddate"
]
},
"offset": {
"isPrimary": true,
"companyId": 0
}
}

response = requests.post(url,data)

return response


Please have a look and any help in this regard would be highly appreciatable. 

 

Regards,

Mahi

Reply
0 Upvotes
Occasional Contributor

Hi There! this info is exactly what we need, is there any chance you can show us the option No.2. This have been the most solid answer to our questions.

 

Thanks!

Reply
0 Upvotes
Visitor

Hey @ebog

 

I would love to know more about option 2. I have a zap set up to send out an email when a deal is added and therefore the update from contact to deal must be instantaneous. I would most appreciate your insight. Thanks for all that you are doing! 

Reply
0 Upvotes
New Contributor

Will this run automatically and update all of my deals on it's own, or is this only true for new deals? I presume it will update all of the existing deals too, would save me a bunch of work. 

Reply
0 Upvotes
Visitor

Hi Erik,

 

Thank you for this detailed explanation! How exactly would that work if I want to copy a deal property and use it to update a contact property? 

 

Thanks,

Paul

Reply
0 Upvotes
Regular Contributor

Erik - yes this is the solution we eventually settled on as well.  Zapier, Zapier Webhooks + Hubspot API and Hubspot Webhooks will let you do some powerful stuff but it can take some work up front.  Thanks for sharing your solution.

Reply
0 Upvotes
Occasional Contributor

Absolutely. My workaround is inefficient so would love to learn how you are doing it.

 

Thanks,

Hansen

Reply
0 Upvotes
Occasional Contributor

@ebogI would love to learn about your solution.

Reply
0 Upvotes
Occasional Contributor | Gold Partner | Certified Trainer

I found a way to work with this issue. Sadly it required more work than I expected. 

In my case, i needed to copy the property "Product" from deal to contact. 

 

So what i managed to do is create a smart list per product (Deal property). 

 

And then use a workflow to change the property "Product" (Contact property) depending on the list where the contact is. 

 

It took a lot of time for such a small fix. I hope HubSpot fixes this issue soon. 

Regular Contributor

@BernardoV can you expand upon this solution? I am trying to understand this in more detail so I can also figure this out. 

Reply
0 Upvotes
Occasional Contributor

Hi @BernardoV,

 

Can you elaborate a bit more on what you did exactly?

 

Much appreciated.

Reply
0 Upvotes
Occasional Contributor

Hi @BernardoV 

 

I would love to learn more about your process here. Could you provide some more color on what exactly you did here to copy your deal properties to contact properties? I am looking to do the opposite (copy contact properties > deal properties), but would love to see if there is a way to move through your process in the opposite direction.

 

Best,

Rachel

Reply
0 Upvotes