Adding external data to create a company property


#1

I am working on a python script and want to create a custom property in hubspot. I have my data stored in a python dictionary which I want to add to the property while creating it. I wanted to understand if we can add external data from any data structure during property creation.

Thanks,
Nishita


How to send list of objects using single send APi
#2

Hey @nishita,

Before you send anything to HubSpot you will convert to JSON so it’s language independent. As long as the shape of your data matches the example listed here: https://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property things will work as you expect.

-Zack


#3

Thanks Zack. I have now all the data in the json format. Just wanted to clarify my understanding as I am trying to do some customization in the email template. For example- For any single account, I am trying to get all the domains associated with it, email volume for each service of each domain pulled into the template dynamically. In this case, first I need to get all the data in Hubspot and then using HubL I would need to custom code in email template. Is that correct?

Nishita


#4

Hey @nishita,

You actually don’t need a custom coded template. Since this is on then you can add personalization tokens right into any template (whether custom coded or built using our drag and drop editor) and it would look something like this {{compnay.email_volume}} assuming the company property you are populating using your python script has the internal name of email_volume.

That will display whatever is stored in the property in your email. Let me know if you have any further questions.

-Zack


#5

@zwolfson - Ok makes sense. But in that case 2 questions- My property is not present in the Hubspot and second it has multi- line options. Please refer to following template as example-https://preview.hs-sites.com/_hcms/preview/template/multi?is_buffered_template_layout=true&portalId=2784216&style_id=hubspot-default-basic&tc_deviceCategory=desktop&template_layout_id=5012979583

Please refer to the services and volume column. Both of these columns are not present in the Hubspot. How do you suggest I add these (what would be the type or enumeration while creating those) and pull in the template?

Thanks,
Nishita


#6

@nishita - Thanks for providing the example, I see what you are trying to do now. Something like this would be only be able to be accomplished via HubSpot Transactional email feature (paid add-on) as the email templating/rendering functionality does not allow for looping through multiple values in a field even if you were to put them into HubSpot. Not to mention the content of this email appears more transactional to me than marketing (though I see there is some marketing info), I believe the Single Send API would be more appropriate for this use case https://developers.hubspot.com/docs/methods/email/transactional_email/single-send-overview

If you are interested, I can start the conversation with the relevant representative here at HubSpot to help you get started with that feature.

-Zack


#7

Thanks for providing this information. So just to clarify are you saying that even if we get all this data(including services, volume, domain) in hub spot company properties, we won’t be able to write custom code using HubL in email template to loop through the data while sending email? If not, before we go ahead with this feature, can we set up a meeting to clearly understand the requirement so that you can provide us appropriate options to move forward. Thanks!

Nishita


#8

@nishita, correct. The reason being is that the personalization tokens get filled in after any HubL logic is executed in emails which is why you wouldn’t be able to loop through the data when sending email.

I will reach out shortly to arrange a meeting.


#9

Yes please put me in contact with someone who can answer all technical implementation questions. This implementation needs to be done on urgent basis, so if we are able to set up something this week preferably tomorrow or Wednesday would be really appreciated. I am also going to add our account manager for Hubspot so please provide few timings which I can forward to our team.

Thanks,
Nishita