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 theHubSpot standard object typesonly theproduct, andmarketing_eventobjects can be retrieved on a publicly accessible page. Any other standard object type must be hosted on a page which is eitherpassword protectedor requires aCMS 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):
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?
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.
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