CMS Development

simosanfilippo
Participant | Partenaire solutions Platinum
Participant | Partenaire solutions Platinum

Get a specific deal associated contact in quotes by Its associated label

Hello everyone!

I'm trying to get a deal associated contact by Its associated label in a quote.

If I use the hubl 'crm_associations' function in a module with hardcoded values I can see the result in the module preview, but when I use the module in a quote template no result is shown.
This is because of a restriction specified in the documentation:

'Please note: for security purposes, of the HubSpot standard object types only the product, and marketing_event objects can be retrieved on a publicly accessible page. Any other standard object type must be hosted on a page which is either password protected or requires a CMS Membership login.  Custom objects do not have this same restriction.'

(Note that contact and deal are both default objects and the quote is not a password protected page)
 
If I use personalization tokens, and more than one contact is associated to the deal, only one contact info is shown (and there is no way to specify which I want to be shown):
simosanfilippo_3-1683704351452.png

Apparently in this case the first associated contact is shown.


By default, in a quote base.html file, some variables are set:

{% set DEAL = ASSOCIATED_OBJECTS.deal %}

In deal associated objects not all contact infos are stored (for example the associated label), so I can't get those infos from that variable.

So, is there any way to print a specific deal associated contact infos by Its associated label?

 

Hope someone can help,

Simone

2 Réponses
simosanfilippo
Participant | Partenaire solutions Platinum
Participant | Partenaire solutions Platinum

Get a specific deal associated contact in quotes by Its associated label

Hi Jaycee, 

you correctly understood the needed steps!

It would be great if we could declare an hubl variable (as we already do for other custom objects) so in the quote editor, I can use those variables in this way in the rich text module: {{ variableName.propertyName }}.

We also considered making an API call to retrieve those infos but we would need a serverless function to avoid having the private app token on the client.

Even having a lambda function, could I set an hubl variable with the value returned by the API call?

 

We need to have an hubl variable, so our customer can use It wherever he wants.

 

Thanks a lot - Simone 

Jaycee_Lewis
Gestionnaire de communauté
Gestionnaire de communauté

Get a specific deal associated contact in quotes by Its associated label

Hey, @simosanfilippo 👋 Thanks for your question.

 

I'd like to invite the community into the conversation — hey, @Kevin-C @SJaeger @piersg would this be a good fit for a serverless function? I feel like I understand the needed steps, but not the execution:

  • get all associated contacts for the given deal ID
  • get detailed information for each contact, and identify the contact with the required associated label
  • call the function from the quote template to get the required information

Do you have any thoughts on other workarounds? 

 

Thank you very much for taking a look! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Votes