HubSpot Ideas

nwcarlson

One-to-many custom object associations

The fact that custom object associations are only many-to-many is a big detriment. Two big reasons.

  1. Cross object associations can't be display on views. For example, because company-to-contact relationship is a one-to-many. This means a contact can only have one company and thus there is no conflict when adding company information on a contact view - which is permissible by the system.
  2. The same things applies to workflows that may be used to copy data from a property on one object to another. For instance, if you have data on a company and you want the contacts to inherit that data via a workflow, that's possible. But if you want to contact to inherit data from an associated custom objects, it's not possible.
15 Replies
M0zz0
Participant | Diamond Partner

+1 on this, I would like to define how associations works, one to many, one to one and not only many to many

agrounds
Member

Throwing support behind this. Being able to define the associations of custom objects (many custom objects to one contact) would be hugely beneficial for my team.

JeffBantz
Contributor

Agreed!  I did find that it's possible to change the setting via API directly.

But, the UI does not get change to disallow adding another association and if users try, it returns an error.

NOTE: I've not fully tested the manual change via API...but it shows as One-to-Many now on the Contact side.

cbray
Member

+1. Not being able to filter views on what should be a single association is really limiting.

Mc8
Member

@JeffBantzyou mentioned you found a way of setting it via the API, is there any documentation for this? I don't see anything in the CRM Custom Objects API docs. I'm looking to create a manyToOne relationship from contacts to a custom object.

 

Thanks

cbray
Member

Also, when you do this does it allow display of the single item in the associated item's list view?

JeffBantz
Contributor

All - while I was able to manually change the property values via the API, when it connects into the UI it doesn't really function in a way that my "brute force" solution is worth documenting and using. Like any exposed data accessible via the API, I changed the property to be one-to-many, but there's no way to enforce that with the UI so it caused more problems than it potentially solved so I reversed it.

 

Honestly, this is very close to a "deal-breaker" in terms of being able to fully utilize the Custom Objects within HubSpot.

The other HUGE painpoint is the inability to disallow adding new values - it would be preferable to be able to disable adding in a new entry in some of our COs.

Our rep has heard the message and indicates that HS realizes there is still a lot of work needed with COs ... but they've demonstrated some pretty good responsiveness over the years.

Mc8
Member

Got this working, first thing is to check your current associations with a GET call to https://api.hubapi.com/crm/v3/schemas/custom-object-id?hapikey=.....

 

If you already have an association setup you'll need to delete it with a delete call and its ID to https://api.hubapi.com/crm/v3/schemas/custom-object-id/associations/id?hapikey=...

 

The last step is to remake the relationship with a POST call to https://api.hubapi.com/crm/v3/schemas/custom-object-id/associations?hapikey=...

You can add json similar to below using data from the first GET call. The important parts are the cardinality. In my case setting the inverseCardinality to "ONE_TO_ONE" achieved what I was looking for.

 

 

 

 

 

{
    "fromObjectTypeId": "custom-object-id",
    "toObjectTypeId": "0-1",
    "name": "customobject_to_contact",
    "cardinality": "ONE_TO_MANY",
    "inverseCardinality": "ONE_TO_ONE"
}

 

 

 

 

 

As JeffBantz stated the UI doesn't seem to fully support this as the Add buttons still appear on the one_to_one side when a record is already set however it actually just overwrites the existing record.

ldf42
Participant

+1 Agree, would be great and beneficial for our customers to be able to define one-to-many, one-to-one or many-to-many associations for custom objects. In both cases - for associations between standard-objects and custom-objects as well as for custom objects themselves.

PedroTayer
Participant

I had this same issue.
The solution purposed by @Mc8 solved for me!

Thank you very much

JKrantz
Contributor

this would be huge for reporting/ visability. even if i could change it to a 1to1, shocking you still cant see that on a view. really limiting what you can do.

eliot_martin
Contributor

Sigh, +1!

 

(Would be nice for once to come to this forum with an issue and not find some creaky workaround based on the API. )

Mike_Eastwood
Key Advisor | Gold Partner

Thank you @Mc8 – super helpful

GEiselt
Contributor

+1, please make this an option.

MFischer
Participant | Platinum Partner

+1 on customer behalf