# Property Relation Mappings

Sometimes, you want to build a goal on object X using a condition on object Y, or break down a KPI for object X by a field on object Y. This is when you use relation properties.&#x20;

{% hint style="info" %}
For example, when you want to build a goal on the CampaignMember object, but you want to datestamp it with the Campaign StartDate, or when you want to filter Opportunities by RecordType, which is a field on RecordType object.
{% endhint %}

You can build a relation property in two places in HockeyStack:

1. When building an Object Based goal (Definitions -> Goals -> New Goal)<br>

   <figure><img src="/files/QTXVPGaVr7QWKBgTuhyJ" alt=""><figcaption></figcaption></figure>
2. In: Settings -> API & Integrations -> Salesforce -> Configure -> Property Relation Mappings -> Add Property

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

## How to Build It

In today's example, we'll build a relation that will pull CreatedDate from the Campaign object to the CampaignMember object.

1. Pick an object **to which** you're pulling data. You can think of it as a destination object. For example, this might be an object you're trying to filter using a field from another object.<br>

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

   \
   For a goal, this will be the object that the goal is based on, and it's picked by default.<br>

   <figure><img src="/files/AzawQfA0o34v5Z8Sl3da" alt=""><figcaption></figcaption></figure>
2. Pick the Relation key. This is the field by which we will identify the relation between the two objects. If you use Excel, think of it like VLOOKUP—we need to know which column acts as the key to match rows across the two objects.\
   You will see a list of relation keys (fields), with the name of the object in brackets.<br>

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

   In this example, we'll be using Campaign (Campaign).
3. After you pick the relation, you need to pick the source field—the one you want to transfer *into* the destination object. You can use the search feature if the list of available fields is lengthy. \ <br>

   <figure><img src="/files/1617D6HDJrhwaaNinR3G" alt=""><figcaption></figcaption></figure>
4. Now the relation mapping is ready to be saved! Click Save in the top right corner

## How to Use It

You can see the full list of relation properties created in your instance by going to Settings -> API & Integrations -> Salesforce -> Configure -> Property Relation Mappings.

The creation of a relation property affects each record from the destination object, which is why it is a time-consuming operation. It takes up to 48 hours for a relation mapping to be ready to use! Until then, the new property is included in the list in settings, but you will not be able to pull it to your definitions in HockeyStack.

When your property is ready to use, you'll see it under the "Action Properties" dropdown whenever you're trying to build a property or break down a report by it. Its displayed name will match what you see in Settings, under "Name in HockeyStack".

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

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

### Troubleshooting

If it's been 48 hours since the creation of your relation field, and you're not seeing it in the Action Properties dropdown in HockeyStack, you need to refresh your cache.&#x20;

* Go to Settings -> Reporting & Tracking -> Clear Account Cache
* Enter the domain and click "CLEAR".

After this operation, your relation field should be available in the Action Properties dropdown. If it's not, please let us know at <support@hockeystack.com>. We're here to help!&#x20;


---

# 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.hockeystack.com/marketing-intelligence/advanced-data-connections/property-relation-mappings.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.
