# Link to other objects

Objects can be linked to other objects to form a hierarchical structure.

The required conditions for this reflect the Salesforce Connect rules, where each child object must have a single parent, identifiable via a field value they share.

Linking objects will enable CRM users to drill up and down between objects. For example, users will be able to drill-down from native Salesforce objects like Accounts and Contacts to External data from your data warehouse like Orders or Transactions.

Linking objects is achieved by converting Salesforce fields from their native type, to a Lookup field. Omnata Connect offers a simplified setup process:\\

![](/files/tnjW5K3UB1jdfO3b6bSa)

## Child of Salesforce Object <a href="#indirect-most-common" id="indirect-most-common"></a>

![](/files/Aqa9f3aqyrOh1dWL78iM)

Within Salesforce, this type of lookup is known as Indirect, and is the most common use case.

To use Indirect, you must first have a Salesforce Object (Standard or Custom) with a custom field that contains identifiers matching those in your Snowflake table. For example, if you had a Snowflake table named FINANCIAL\_TRANSACTIONS:

| TRANSACTION\_ID (text, PK) | MERCHANT\_ID (number(10,0)) | TRANSACTION\_DATETIME (datetime) | TRANSACTION\_AMOUNT (number(10,2)) |
| -------------------------- | --------------------------- | -------------------------------- | ---------------------------------- |
| 6b8a942c                   | 123                         | 2017-04-09 17:05:03.000          | 45.67                              |
| 3c9a9e4d                   | 123                         | 2017-04-09 17:05:08.000          | 100.00                             |
| cec0b3c7                   | 123                         | 2017-04-09 17:05:12.000          | 21.00                              |
| 42e8d696                   | 123                         | 2017-04-09 17:05:30.000          | 50.45                              |

You could link to a Merchant ID field on the Account Object, provided it had a compatible data type, and had the "unique" flag set:

![](/files/q2dVoDded3sJIWofAbuO)

**Note: The custom field should also be marked as case sensitive, to ensure its values match with those in Snowflake.**

Now that the objects are linked in this way, the Omnata Lightning Component will be able to detect the relationship when added to the record page of the parent object.

## Child of another External Object <a href="#external-lookup" id="external-lookup"></a>

![](/files/wdPLuD21obPxWk9sObD6)

This is similar to Indirect Lookup, except that the parent record also sits outside of Salesforce. This is useful when your Data Warehouse contains hierarchical data and you need to drill down.


---

# 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.omnata.com/omnata-product-documentation/omnata-connect-for-salesforce/omnata-with-salesforce-lightning-components/link-to-other-objects.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.
