Using Contact property as parameter in Custom Modules

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.

Hey, @matheus_jiran :waving_hand: 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:

{{ contact.hs_object_id }}
{% set contact_id_str = contact.hs_object_id|string %}
{{ contact_id_str }}

Best,

Jaycee