# Adding HubSpot Properties to Your Template

Hubspot records contain data as properties and these properties are used to retrieve and display your data. Each property is a key-value pair. The key is an identifier shared by all records that contain that property. The value is the value unique to that specific record. So, all records of a particular object type will have the same keys (e.g. contacts will having "lastname", "firstname", "email", etc.), but their values will be unique (e.g. "John", "Rachel", "Andrew", etc.).\
\
In order to get your Hubspot data to merge with your Documint templates you will need to find the property names (keys) and paste them into your template. The Documint Hubspot extension contains an easy table where you can see and copy all your record's properties.

The Documint app can access property data for these objects:

* **Contacts**
* **Companies**
* **Deals**
* **Tickets**
* **Custom Objects**

## Viewing Properties

To search and view the available properties, just click the **View Properties** button near the bottom of the dashboard.

<figure><img src="/files/5NJHqrOrpmWmnnn2yEqY" alt=""><figcaption></figcaption></figure>

You can filter and view all properties for your object as well as the properties for associated objects.

<figure><img src="/files/IzR9F3BTFaity0DKl3cv" alt=""><figcaption><p>The properties table also show the properties' types and group identifiers as well as if they are custom or Hubspot defined</p></figcaption></figure>

## Primary properties

Primary properties are properties that belong to the object type that is currently selected.&#x20;

{% hint style="info" %}
See [Working with Custom Object Data](/integrations/hubspot/working-with-custom-object-data.md) on how to change the selected object.
{% endhint %}

Copy a proprety by highlighting it and pressing "Ctrl+C". Then paste it into your template.

<figure><img src="/files/p9fw8Of7H4QnOWwrKIvY" alt=""><figcaption><p>Copy a token.</p></figcaption></figure>

<figure><img src="/files/HXCWS5HsJgtF1CdlgnID" alt=""><figcaption><p>Paste it!</p></figcaption></figure>

1. Open the schema
2. Add a field
3. Paste the property
4. Delete the curly braces
5. Save it
6. Drag the token to the template

[Learn more](/templates/working-with-dynamic-data/fields-editor.md) <mark style="color:$info;">(fields editor)</mark>

## Association properties

Association properties are the properties of associated objects. For example, your selected object is contacts and its associations are contacts (other contacts), companies, deals, and tickets.&#x20;

Because associations are lists/arrays of data for related records (see [array data type](/legacy-documentation/data-and-variables/data-types.md#arrays)), you can either display the values for associations by looping over each record, or you can just display data for a singe record from the list (This is useful when an associations list only contains a single associated record).&#x20;

{% hint style="info" %}
The Documint app does not currently provide association data for custom objects.
{% endhint %}

## Displaying values for Associations' Lists

To display values from an associated list, let's start with the schema.

1. Create a collection field

<figure><img src="/files/ekkpsPLQVvi3DOEt6czf" alt="" width="563"><figcaption></figcaption></figure>

2. Its name will be the name associated list in [snake case](https://developer.mozilla.org/en-US/docs/Glossary/Snake_case) format

| List       | Field Name  |
| ---------- | ----------- |
| Line Items | line\_items |
| Companies  | companies   |
| Contacts   | contacts    |
| Deals      | deals       |
| Tickets    | tickets     |

In this example, we will use Line Items

<figure><img src="/files/XKgYQkiOMYIEjj2zO4ID" alt="" width="563"><figcaption></figcaption></figure>

3. Go to the properties in HubSpot and access that list. In Use Type, select 'All items'. Copy the property associated with that list

<figure><img src="/files/on6bRf1ZoynW1z0bPTCS" alt=""><figcaption></figcaption></figure>

3. In the schema, click on 'Add Collection Field', paste the property, and delete the curly braces

<figure><img src="/files/0GK7ZudJJKzXfB1TpCvv" alt="" width="563"><figcaption></figcaption></figure>

4. Don't forget to check its field type. In this case, it's a number

<figure><img src="/files/BYD2ZpUNVe1OzZ5zbnYH" alt="" width="563"><figcaption></figcaption></figure>

5. Save the chema

<figure><img src="/files/peTKdu6G5MuYmnBvZQTG" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %}
For each associated list, you'll need to create a separate collection
{% endhint %}

{% hint style="info" %}
Adding only the fields you are going to use on the template will be best to manage
{% endhint %}

### Single Value

If you'd like to display values from a single record, here is how it's done:

1. Place the token on your template and double-click it

<figure><img src="/files/tKkvQbdogLzZ82o5xKpp" alt=""><figcaption></figcaption></figure>

2. On Edit Token, in the 'return type' section, you'll be able to select the position of the item in that list you want to display. By default, it will display the first one

<figure><img src="/files/2nmg3dit5EXpxU3Setb7" alt=""><figcaption></figcaption></figure>

3. But if you want to display an item in another position, just select custom from the dropdown options and inform its index

<figure><img src="/files/1JHAR1tBprAmUhLFKfFq" alt=""><figcaption></figcaption></figure>

Essentially, to display only the first item, you'll just need to drag the template from that list into the template builder.&#x20;

### All values

You can also display all items in the associated list. For that, you'll need to set up a loop.&#x20;

First, drag the tokens into the template

<figure><img src="/files/CydbwcjLgWjZNoETlMlB" alt=""><figcaption></figcaption></figure>

In your Documint template, select the parent element that will be repeated for each item in the list, then click "Edit logic"

<figure><img src="/files/M6fW49Sq3ouQ6Q3xOToh" alt=""><figcaption></figcaption></figure>

Select the associated list name from the List Field dropdown.

<figure><img src="/files/A6JYwscylvXdImXqKTpA" alt="" width="563"><figcaption></figcaption></figure>

You're all set to generate your document!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.documint.me/integrations/hubspot/adding-hubspot-properties-to-your-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
