> For the complete documentation index, see [llms.txt](https://docs.jetadmin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jetadmin.io/classic-app-builder/classic-tutorials/part-2-intermediate/single-relations.md).

# Single relations

**Single relations** help you fetch data from the **related collections**.&#x20;

To illustrate how it works, let's imagine we have the `Transactions` table that doesn't contain a **customer's email** and the `Users` table that contains the customer information including the email:

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkNJppa1ZfoM33DXJBQ%2F-MkNPkf61ukzo95Sex7S%2Fimage.png?alt=media\&token=54d96850-ae15-4bab-aa1f-9844298b2819)

And we want to **display the email** in the `Transactions` list:

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkNJppa1ZfoM33DXJBQ%2F-MkNSOI-p4c83n5VXJT5%2Fimage.png?alt=media\&token=489cfb7f-3b49-4543-b938-b56c12e5c0c1)

First of all, we identify how our tables are **related**: for each user, there are several transactions that are related to the users list by the **ID** and **Customer ID fields:**

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkNJppa1ZfoM33DXJBQ%2F-MkNN1Zfv7MgU1uT4A6a%2Fsdhx.PNG?alt=media\&token=c2ff7cac-cc06-42e0-b299-b12ee38aba8a)

Now, let's create a new **custom column** in the `Transactions` table:

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkNJppa1ZfoM33DXJBQ%2F-MkNTfKtz24SDPcnPcsU%2Fdeep1.gif?alt=media\&token=86bdd404-fd0e-44fb-8fca-cfc1ccb92102)

Then change the **column type** to `Link to record`

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkNJppa1ZfoM33DXJBQ%2F-MkNUgvW4-UXL5u_HPQL%2Fdeep2.gif?alt=media\&token=65118cb9-01b9-40e8-a383-d6c2d8e78a60)

Now, we need to select where we'll get the user email from (a related `Users` table), what field in the `Users` table is used to set relations with the `Transactions` table (the `ID` field), and what field from the `Users` table we'd like to display (the `Email` field):

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkNJppa1ZfoM33DXJBQ%2F-MkNWT6xG9xGbSQ0OZDQ%2Fdeep3.gif?alt=media\&token=5b0a4b91-7a2d-42ec-84b9-30e9432a54c6)

And the **final step** is to get our custom field value from the `Transactions` table field that sets relations to the `Users` table (the `Customer ID` field):

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkNJppa1ZfoM33DXJBQ%2F-MkNXnKZh7yXZuEOwA7k%2Fdeep4.gif?alt=media\&token=608989ad-a4a8-4da0-8610-d3b07b5b2c4a)

Now, let's make UI components **dynamically visible** based on a rule:

{% content-ref url="/pages/-Mkg6VpZJSj1ZRY0u6Qf" %}
[Conditional Visibility](/classic-app-builder/classic-tutorials/part-2-intermediate/conditional-visibility.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.jetadmin.io/classic-app-builder/classic-tutorials/part-2-intermediate/single-relations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
