CMS Development

matheus_jiran
Contributor | Elite Partner
Contributor | Elite Partner

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.
0 Upvotes
1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

Using Contact property as parameter in Custom Modules

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


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes