# Fetching Associated Custom Objects into Quote template

**URL:** <https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552>\
**Category:** Sales Hub Tools\
**Tags:** object, how-to, enterprise, sales\
**Created:** [June 8, 2022, 4:59am UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552 "2022-06-08T04:59:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisChiha](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrischiha/32/90510_2.png) [@ChrisChiha](https://community.hubspot.com/u/ChrisChiha)\
**Post date:** [June 8, 2022, 4:59am UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/1 "2022-06-08T04:59:25Z")

</div>

Hello,

So i am creating a custom quote template that can be generated from a deal, and that gets populated from the deal itself and the objects associated to it.

So far i was able to fetch property value from the deal, company and contact object. (For example contact first name+last name, deal bank name, company name,…)

 ![Screen Shot 2022-06-08 at 8.51.32 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/1/b1070926552d2b1258b2257d75e8129cb73a2299.png)

But when i try to fetch a certain property value from the custom object associated to the deal, it is not working when i try the same method as the contact and deal object.

I was able to fetch all the properties of the associated custom object using the below lines of code:

{% setcustomobject=QUOTE.associated\_objects.deal.associated\_objects.custom\_objects %}

{% for Property in customobject %}  
{{ Property }}  
{% endfor %}  
 **Note to avoid confusion: my custom object is named “Property”. It refer to a property/house**  
   
The above line of code returns the following (All the properties in the associated custom object).

 ![Screen Shot 2022-06-08 at 8.49.32 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/e/e2ea5b6f0e67eba7865a3d521ba54e881cc8c8b4.png)

I almost tried everything to try to fetch only the “property\_name” for example, but it wouldn’t work. I just want to be able to call only one property value from the associated custom object.

Thanks in advance for any input you couple provide.

@ChrisChiha

---

<div class="post-metadata">

**Author:** ![TitiCuisset](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@TitiCuisset](https://community.hubspot.com/u/TitiCuisset)\
**Post date:** [June 9, 2022, 8:28am UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/2 "2022-06-09T08:28:08Z")

</div>

Hi @ChrisChiha

Thank you for reaching out and for all the details!

I want to tag some of our experts here - @himanshurauthan @LMeert @miljkovicmisa do you have any advice for @ChrisChiha on this?

Thank you!

Best

Tiphaine

---

<div class="post-metadata">

**Author:** ![ChrisChiha](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrischiha/32/90510_2.png) [@ChrisChiha](https://community.hubspot.com/u/ChrisChiha)\
**Post date:** [June 9, 2022, 9:53am UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/3 "2022-06-09T09:53:12Z")

</div>

Hello [@TitiCuisset](https://community.hubspot.com/t5/user/viewprofilepage/user-id/89150) ,

Please note that i was able to solve the above issue by referencing the custom object type ID found the the index page of the custom object:

{% set customobject = template\_data.quote.associated\_objects.deal.associated\_objects.custom\_objects.customobjecttypeID %}

---

<div class="post-metadata">

**Author:** ![TitiCuisset](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@TitiCuisset](https://community.hubspot.com/u/TitiCuisset)\
**Post date:** [June 9, 2022, 12:36pm UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/4 "2022-06-09T12:36:36Z")

</div>

Thank you for sharing this answer @ChrisChiha !

---

<div class="post-metadata">

**Author:** ![Gabriel\_Guigue](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gabriel_guigue/32/89259_2.png) [@Gabriel\_Guigue](https://community.hubspot.com/u/Gabriel_Guigue)\
**Post date:** [September 13, 2022, 6:32am UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/5 "2022-09-13T06:32:57Z")

</div>

Hello @ChrisChiha

Sorry for the dummy question, but where do you copy these lines of code, inside your custom Quote template? I mean in which “Container” of the custom Quote template?  
Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![ChrisChiha](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrischiha/32/90510_2.png) [@ChrisChiha](https://community.hubspot.com/u/ChrisChiha)\
**Post date:** [September 13, 2022, 8:33am UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/6 "2022-09-13T08:33:53Z")

</div>

Hello [@Gabriel\_Guigue](https://community.hubspot.com/t5/user/viewprofilepage/user-id/76533) ,

You can use these lines of codes inside your HTML/Hubl quote template in the design manager tab

---

<div class="post-metadata">

**Author:** ![Gabriel\_Guigue](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gabriel_guigue/32/89259_2.png) [@Gabriel\_Guigue](https://community.hubspot.com/u/Gabriel_Guigue)\
**Post date:** [September 29, 2022, 10:37am UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/7 "2022-09-29T10:37:12Z")

</div>

Thanks a lot @ChrisChiha for your prompt reply.  
Inside the design manager, I cannot see the HTML/Hubl quote template. Maybe I’m not looking inside the right place. Could you please share a screenshot?  
Thanks.

---

<div class="post-metadata">

**Author:** ![WPeraltaLopez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wperaltalopez/32/5125_2.png) [@WPeraltaLopez](https://community.hubspot.com/u/WPeraltaLopez)\
**Post date:** [September 20, 2023, 5:24pm UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/8 "2023-09-20T17:24:02Z")

</div>

For example if you custon object ID is: **2\_4679355**  
you can use:  
{% set customobject = template\_data.quote.associated\_objects.deal.associated\_objects.custom\_objects.\_2\_4679355 %}

---

<div class="post-metadata">

**Author:** ![jeremymandle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jeremymandle/32/76800_2.png) [@jeremymandle](https://community.hubspot.com/u/jeremymandle)\
**Post date:** [September 21, 2023, 11:47pm UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/9 "2023-09-21T23:47:25Z")

</div>

Hi [@WPeraltaLópez](https://community.hubspot.com/t5/user/viewprofilepage/user-id/192170) and @ChrisChiha,

This post helped me greatly.

One thing I just cannot find anywhere, literally anywhere is the syntax for using values from properties of Custom Objects. I can output the properties of the associated Custom Object, but using the same HubL syntax as other OOB modules used by Quote Templates I cannot get values from Custom Object properties to display.

I’m trying it like this:

{{ BILLING\_ENTITY.billing\_entity }}

which should output “HubSpot” for example where HubSpot is the text value of the Custom Object property with the internal name: billing\_entity.

```lia-code-sample
{# associated company data: name, address, city, state, zip, country #}
{% from '../../imports/mock_data.html' import SAMPLE_TEMPLATE_DATA as mock_data %}
{% set module_data = template_data.module_data %}
{% set QUOTE = template_data.quote || mock_data.quote %}
{% set DEAL = QUOTE.associated_objects.deal %}
{% set BUYER_CONTACTS = QUOTE.associated_objects.contacts %}

{# data to pull from Billing Entities custom object #}
{% set BILLING_ENTITY = template_data.quote.associated_objects.deal.associated_objects.custom_objects._2_17681733 %}

this should display the billing entity name value: {{ BILLING_ENTITY.billing_entity }}
<br />
this should display the billing address line 1 value: {{ BILLING_ENTITY.billing_entity__address_line_1 }}
<br /><br />

{# this is for debugging to prove that the custom object is available #}
{% for billing_entities in BILLING_ENTITY %}
{{ billing_entities }}
{% endfor %}

{% if module.show_billing_entity_name && BILLING_ENTITY.billing_entity %}
<span>
 <b>{{ BILLING_ENTITY.billing_entity }}</b>
</span>
<br>
{% endif %}

```

---

<div class="post-metadata">

**Author:** ![jeremymandle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jeremymandle/32/76800_2.png) [@jeremymandle](https://community.hubspot.com/u/jeremymandle)\
**Post date:** [September 22, 2023, 1:37am UTC](https://community.hubspot.com/t/fetching-associated-custom-objects-into-quote-template/58552/10 "2023-09-22T01:37:32Z")

</div>

Figured it out. Rookie mistake and I am an uber-rookie at HubSpot.

Forgot to wrap the whole thing in a simple “for” loop like so:

```lia-code-sample
{% for billing_entities in BILLING_ENTITY %}
 {{ billing_entities.billing_entity }}
{% endfor %}

```
