# Using Contact property as parameter in Custom Modules

**URL:** <https://community.hubspot.com/t/using-contact-property-as-parameter-in-custom-modules/93699>\
**Category:** CMS Development\
**Created:** [November 9, 2023, 6:02pm UTC](https://community.hubspot.com/t/using-contact-property-as-parameter-in-custom-modules/93699 "2023-11-09T18:02:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matheus\_jiran](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/matheus_jiran/32/222_2.png) [@matheus\_jiran](https://community.hubspot.com/u/matheus_jiran)\
**Post date:** [November 9, 2023, 6:02pm UTC](https://community.hubspot.com/t/using-contact-property-as-parameter-in-custom-modules/93699/1 "2023-11-09T18:02:30Z")

</div>

Hey, I’m trying to pull the Deals associated with a Contact record into an email template module, but I’m having trouble with the crm\_associations() function.

It works when the contact ID is hard coded:

`% set contact_deals = crm_associations("682151", 'HUBSPOT_DEFINED', 4, "", 'dealname,amount,dealstage,createdate,closedate') %`

But it does not work I pass the Contact ID as a variable (I’ve checked and the type is string).

`% set contact_deals = crm_associations(contact.hs_object_id, 'HUBSPOT_DEFINED', 4, "", 'dealname,amount,dealstage,createdate,closedate') %`

I’ve tried forcing the conversion to string, but did not work.

Any way I could work around this?

Thank you in advance.

---

<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:** [November 13, 2023, 10:01pm UTC](https://community.hubspot.com/t/using-contact-property-as-parameter-in-custom-modules/93699/2 "2023-11-13T22:01:03Z")

</div>

Hey, [@matheus\_jiran](https://community.hubspot.com/t5/user/viewprofilepage/user-id/600238) 👋 Thanks for your question! Did you get this resolved?

If not, did you try adding a debug output right before the function call? To see what values are being passed.

Example:

```lia-code-sample
{{ contact.hs_object_id }}
{% set contact_id_str = contact.hs_object_id|string %}
{{ contact_id_str }}

```

Best,

Jaycee
