# How associate a custom object in a customized quote template

**URL:** <https://community.hubspot.com/t/how-associate-a-custom-object-in-a-customized-quote-template/137127>\
**Category:** CMS Development\
**Created:** [July 30, 2025, 12:15pm UTC](https://community.hubspot.com/t/how-associate-a-custom-object-in-a-customized-quote-template/137127 "2025-07-30T12:15:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ViniBernardo](https://avatars.discourse-cdn.com/v4/letter/v/a6a055/32.png) [@ViniBernardo](https://community.hubspot.com/u/ViniBernardo)\
**Post date:** [July 30, 2025, 12:15pm UTC](https://community.hubspot.com/t/how-associate-a-custom-object-in-a-customized-quote-template/137127/1 "2025-07-30T12:15:34Z")

</div>

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:

 ![ViniBernardo_0-1753877176424.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/79bf5f9cc9efc8cd21afc5d9ec9cc6240b1236fa.png)

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?

**``**

---

<div class="post-metadata">

**Author:** ![BrandonWoodruff](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brandonwoodruff/32/61045_2.png) [@BrandonWoodruff](https://community.hubspot.com/u/BrandonWoodruff)\
**Post date:** [July 30, 2025, 1:04pm UTC](https://community.hubspot.com/t/how-associate-a-custom-object-in-a-customized-quote-template/137127/2 "2025-07-30T13:04:11Z")

</div>

Hello, I would attempt using matching keys instead:

#### 

If you’re doing:

{% set pet = PETS[loop.index0] %}

That assumes your line\_items array and your pets array are in perfect 1-to-1 order — and that’s not guaranteed unless you enforce that relationship somewhere else in your data model.

#### 

Instead I would attempt using a matching key instead:

Ideally, your Line Items and Pets have some shared key (like a matricula, pet\_id, or even a matching order) so you can do something like:

{% for item in QUOTE.associated\_objects.line\_items %} {% set pet = PETS | selectattr(“matricula”, “equalto”, item.product\_id) | first %} \<tr\> \<td\>{{ pet.nome\_do\_pet }}\</td\> \<td\>{{ item.name }}\</td\> \<td\>{{ item.price|format\_currency }}\</td\> \</tr\> {% endfor %}

Make sure item.product\_id or a similar field on the line item maps correctly to something like pet.matricula.

Let me know if this helps, or if you have any other questions!

* * *

✔ Was I able to help answer your question? Help the community by **marking it as a solution.**

| ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/3/d314478a36473977ed45320812b9331d25e0d3c4.jpeg) | **[Brandon Woodruff  
Senior Software Developer @ ](https://www.linkedin.com/in/brandon-woody-woodruff/)[Pearagon](https://www.pearagon.com/)**Still have questions? Reach out at [brandon@pearagon.com](mailto:brandon@pearagon.com) ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/c/dcad77e6cf96145dd117147531ae4423b9b5cd91.png) |
