Hi everyone,
I’m working on a customized quote template in HubSpot, and I need to display data from a custom object called Pets, which is associated with a deal.
The idea is to generate a pricing table within the quote that shows each associated line item along with the corresponding Pet. So the desired output would look something like:
Pet Name | Plan Name | Price
Nina | Plan A | R$100
Sonic | Plan B | R$80
The “Pets” custom object is already set up in the portal with properties such as “matricula”, “nome_do_pet”, and “sexo_do_pet”. It is also correctly associated with deals using a label called “Pet”.
Line items render correctly using the variable “QUOTE.associated_objects.line_items”, and I am successfully looping through them.
To retrieve the Pets, I initially tried using:
{% set PETS = DEAL.associated_objects.Pet %}
However, this returned nothing. I then added a debug line to print out the full object structure:
{{ DEAL.associated_objects|tojson }}
And I noticed that the custom object data is actually being returned inside a key like:
DEAL.associated_objects.custom_objects._2_47534741
That array contains the Pets data like this:
[
{ “matricula”: “Nina”, “nome_do_pet”: “Nina” },
{ “matricula”: “Sonic”, “nome_do_pet”: “Sonic” }
]
So I tried:
{% set PETS = DEAL.associated_objects.custom_objects._2_47534741 %}
And then inside the loop:
{% set pet = PETS[loop.index0] %}
{{ pet.nome_do_pet }}
Even though the data is clearly there (confirmed by tojson), nothing is rendered when I try to print the Pet name. No error, just no output. remains blank.
Are custom object associations supported in quote templates using the custom_objects._ID format?
Is there a more stable or recommended way to pull data from custom objects within quote templates?
``


