APIs & Integrations

MSanchez
Participant

JSON Array field - Segment.com / Hubspot integration

Hey there,

 

I am having an issue with a custom property in Hubspot.
Basically we have a an array field, let's call it names which may look like this: 
names: ["name1", "name2"]
We try to get this into a Hubspot custom property that has been defined.

What makes things difficults to debug is that we use Segment.com as our CDP so in fact we send this names field as a Segment.com trait, then Segment.com is forwarding this to Hubspot through its dedicated integration.

The field correctly appears in Segment.com data, as a JSON array, but never seems to correctly feed my contacts properties in Hubspot, whatever the field type I choose (I tried multiline string, string, checkbox and select).

I also tried to change the field format that is sent to Segment.com, instead of 
names: ["name1", "name2"]
I tried
names: "name1,name2"
(which is far from ideal as it would be Hubspot specific)

Any idea what is going wrong?
What is the correct way to get multiple values for a property into Hubspot from the API? And how can I make it work from Segment.com?

Thanks a lot in advance to anyone who can give me a tip in the right direction 🙂

Regards,
Mathieu

 

 

0 Upvotes
5 Replies 5
georgephan
Participant

JSON Array field - Segment.com / Hubspot integration

I can help you fix this, feel free to connect. Thanks

0 Upvotes
MSanchez
Participant

JSON Array field - Segment.com / Hubspot integration

Hey @georgephan ,
What do you mean exactly? Is there a better solution than the one I mention above? If yes, can you give me more details?
Best,
Mathieu

 

0 Upvotes
OtavioCapila
Participant | Diamond Partner
Participant | Diamond Partner

JSON Array field - Segment.com / Hubspot integration

Hi MSanchez,

In order to be able  to update a property on Hubspot with a data coming from Segment, you have to pass a property(with the same name you've created on Hubspot) inside the traits object.

Something like this:carbon (1).png


Ping me if you have any other doubt.

MSanchez
Participant

JSON Array field - Segment.com / Hubspot integration

Hey @OtavioCapila 
Thx for the help.

Yes I was doing this correctly (as it worked for other properties) but here is my analysis :
- Hubspot does not have a proper "array" type for its properties
- what is closest to an array are the enumeration properties like Multiple checkboxes but it requires you to define all possible values in advance and format the string in Segment traits specifically for Hubspot

I ended up leaving the Segment trait as an array and define the property in Hubspot as a string. Segment is smart enough to "cast" the array as a string for Hubspot to ingest it.
In the end you get a string like this in the Hubspot property: ["Val1", "Val2", "Val3"]
Which is not very pretty but good enough to do proper filters/searches when you need them (and apparently you can even set a workflow to format it/convert it into another format if needed, but I don't know much more about this).

Thanks!

dennisedson
HubSpot Product Team
HubSpot Product Team

JSON Array field - Segment.com / Hubspot integration

Hey @MSanchez 

I have never used segment so I am not going to be much help. 

@JDobbin , @OtavioCapila have worked with it and might be able to add some ideas for you. 😀