# CRM\_Associations function for custom objects not working

**URL:** <https://community.hubspot.com/t/crm-associations-function-for-custom-objects-not-working/67293>\
**Category:** CMS Development\
**Tags:** design-manager, html, enterprise\
**Created:** [October 17, 2022, 4:18pm UTC](https://community.hubspot.com/t/crm-associations-function-for-custom-objects-not-working/67293 "2022-10-17T16:18:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisChiha](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrischiha/32/90510_2.png) [@ChrisChiha](https://community.hubspot.com/u/ChrisChiha)\
**Post date:** [October 17, 2022, 4:18pm UTC](https://community.hubspot.com/t/crm-associations-function-for-custom-objects-not-working/67293/1 "2022-10-17T16:18:39Z")

</div>

Hello,

I am trying to fetch the associated custom objects to my contact into a landing page but not succeeding. Always returning “null”.

The code is working for normal objects, but not for custom objects:

```auto
{% if dynamic_page_crm_object %} 

{% set user = dynamic_page_crm_object %} 

<h1>{{user.firstname}} {{user.lastname}} <br/> {{user.email}} <br/> {{user.phone}} </h1>

{% set contact_id = user.hs_object_id %}

{% set custom_objects = crm_associations(contact_id, "USER_DEFINED", "_2_4948679", "property_name", false) %}

<p>{{custom_objects|pprint }}</p>

{% endif %}

```

Am I doing anything wrong with regard to custom objects?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [October 18, 2022, 3:12pm UTC](https://community.hubspot.com/t/crm-associations-function-for-custom-objects-not-working/67293/2 "2022-10-18T15:12:41Z")

</div>

Hi, @ChrisChiha 👋 Thanks for reaching out! Hey, @Sjardo @Anton @tmcmillan99, do you have any experience or tips you can share with @ChrisChiha? Thank you very much for taking a look! — Jaycee

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [October 18, 2022, 5:40pm UTC](https://community.hubspot.com/t/crm-associations-function-for-custom-objects-not-working/67293/3 "2022-10-18T17:40:25Z")

</div>

Hi @ChrisChiha ,

It seems that you are passing the Custom Object ID as the association definition ID, which will not work. You need to check what the ID is of your association between your contact object and your custom object. You can do so by [retrieving your custom object schema.](https://developers.hubspot.com/docs/api/crm/crm-custom-objects#tab-3)  
You can make the API call from the docs itself, take a look at the ‘Get an existing schema’ part and add your custom object name or object type ID to the params. You can then make a test call on the right side.

 ![Schermafbeelding 2022-10-18 om 19.39.59.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/a/3a60d73b07564865d2bfe3c35d70de5c923f03d2.jpeg)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [October 18, 2022, 5:46pm UTC](https://community.hubspot.com/t/crm-associations-function-for-custom-objects-not-working/67293/4 "2022-10-18T17:46:49Z")

</div>

Thanks, @Teun 🙌

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [October 18, 2022, 5:47pm UTC](https://community.hubspot.com/t/crm-associations-function-for-custom-objects-not-working/67293/5 "2022-10-18T17:47:51Z")

</div>

Happy to help!
