# Filter Data using Association in Custom Object

**URL:** <https://community.hubspot.com/t/filter-data-using-association-in-custom-object/96160>\
**Category:** CMS Development\
**Created:** [December 15, 2023, 6:18am UTC](https://community.hubspot.com/t/filter-data-using-association-in-custom-object/96160 "2023-12-15T06:18:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RikenPrajapati](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@RikenPrajapati](https://community.hubspot.com/u/RikenPrajapati)\
**Post date:** [December 15, 2023, 6:18am UTC](https://community.hubspot.com/t/filter-data-using-association-in-custom-object/96160/1 "2023-12-15T06:18:00Z")

</div>

Hello,

I have created custom object for Pets, I am associating contact to Pet. I am able to get all pet detail using crm\_objects but I want to get pets which associated to specific contact by email. So it’s something like get pets where associated-contact-email = “specific-email”

How can I do this using HubL in custom module?

---

<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:** [December 15, 2023, 5:34pm UTC](https://community.hubspot.com/t/filter-data-using-association-in-custom-object/96160/2 "2023-12-15T17:34:39Z")

</div>

Hey, @RikenPrajapati The **[HubL function](https://developers.hubspot.com/docs/cms/hubl/functions#crm-associations)****[crm\_associations](https://developers.hubspot.com/docs/cms/hubl/functions#crm-associations) **requires a record ID. You’ll either need to make a separate call to get the** [Contact’s record ID from the email address](https://developers.hubspot.com/docs/api/crm/contacts)**, or look at another approach to accomplish your goal.

Best,

Jaycee
