Support for a One-to-Many mapping for a Contact Property not restricted to a list of allowed values

SOLVE
Highlighted
New Contributor

We want a Contact to have a property "subjects" that will contain a list of subjects they the Contact is interested in, (i.e. Accounting, Computer Graphics, Product Design, etc.). The list of allowed values for "subjects" is about 300 items long and constantly updating, so it doesn't seem feasible to use an "enumeration" data type to represent it. The only solution I see is to save the value as multi-line text, where each line represents a "subject" they are interested in.

 

Is there a better way to accomplish this One-to-Many mapping?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
HubSpot Moderator

Hi @FrankYu,

 

This is a common issue I've seen come up over the past few years. The multi-line text field approach is probably your best bet if the data is constantly changing. You could create a custom property called "Subjects" and ensure it is set as a "multi-line text" property. You could then "create or update a contact" and pass values as shown below:

 

{
  "properties": [
    {
      "property": "email",
      "value": "testcontact001@hubspot.com"
    },
    {
      "property": "firstname",
      "value": "Jack"
    },
    {
      "property": "subjects",
      "value": "Option 1, Option 2, Option 3, Option 4"
    }
 ] 
}

Once the data is passed to HubSpot you would then be free to segment using lists or enroll into workflows based on the data contained in this property.

 

Be mindful that if you choose to move forward with the above option if you pass a new value in to the "subjects" property  at a later stage it won't be appended. It will replace all existing values.  Therefore you'd need to ensure you pass through a request like this in order to update a contact accordingly:

 

{
  "properties": [
    {
      "property": "subjects",
      "value": "Option 1, Option 2, Option 3, Option 4, New Subject Here"
    }
 ] 
}

I hope this helps,

Jack

Jack Coldrick
Solutions Engineer @ HubSpot
Add me on LinkedIn
1 Reply 1
HubSpot Moderator

Hi @FrankYu,

 

This is a common issue I've seen come up over the past few years. The multi-line text field approach is probably your best bet if the data is constantly changing. You could create a custom property called "Subjects" and ensure it is set as a "multi-line text" property. You could then "create or update a contact" and pass values as shown below:

 

{
  "properties": [
    {
      "property": "email",
      "value": "testcontact001@hubspot.com"
    },
    {
      "property": "firstname",
      "value": "Jack"
    },
    {
      "property": "subjects",
      "value": "Option 1, Option 2, Option 3, Option 4"
    }
 ] 
}

Once the data is passed to HubSpot you would then be free to segment using lists or enroll into workflows based on the data contained in this property.

 

Be mindful that if you choose to move forward with the above option if you pass a new value in to the "subjects" property  at a later stage it won't be appended. It will replace all existing values.  Therefore you'd need to ensure you pass through a request like this in order to update a contact accordingly:

 

{
  "properties": [
    {
      "property": "subjects",
      "value": "Option 1, Option 2, Option 3, Option 4, New Subject Here"
    }
 ] 
}

I hope this helps,

Jack

Jack Coldrick
Solutions Engineer @ HubSpot
Add me on LinkedIn