HubL Functions

AZbarouski
Member

Hi!

I have a problem!

I read the info on how to work with crm_associations here https://developers.hubspot.com/docs/cms/hubl/functions. As I see from the documentation there are 3 main properties "idassociation category, association type id".

I know how to use association category and association type id, it's clear. The main problem is in id I want to use it dynamically. I don't have the id of the deal, for example, 1234, I just know the property deal.hs_object_id, and where this property stores. deal.hs_object_id is always different because I sent the email to the different users with different ids.

I want to to use crm_associations like this crm_associations(deal.hs_object_id, 'HUBSPOT_DEFINED', 5), not like this crm_associations(1234, 'HUBSPOT_DEFINED', 5).

 

My question is, how can I use deal.hs_object_id as a variable in the crm_associations function? Is it finally possible?

 

The same problem with crm_object https://developers.hubspot.com/docs/cms/hubl/functions#crm-object , I can't use the query dynamically.

{% set deal = crm_object("deal", deal.hs_object_id) %}

{{ deal }}

 

0 Upvotes
3 Replies 3
natsumimori
Community Manager

Hi @AZbarouski , thank you for your post.

 

I wanted to tag in @Indra and @miljkovicmisa who have shared great knowledge around Hubl in the Community. Would you be able to weigh in here?

0 Upvotes
Teun
Key Advisor | Diamond Partner

Hi @AZbarouski ,

I had this working with retrieving associated objects with a contact ID. I used the programmable email beta with a custom module. I first set the contact ID to a custom variable and then used it to retrieve the associated custom objects.
I'll see if I can retrieve the code from an old sandbox.



Did my answer solve your issue? Help the community by marking it as the solution.
natsumimori
Community Manager

Thank you @Teun 😄

0 Upvotes