# Relations & Lookups

### Relation (Link to another record)

The relationship allows you to link records that have a relation between them. This is particularly helpful when you have multiple tables of related items or concepts. For example, if you have a table of products and a table of categories, you can use a related field to link each product to the category to that they belong.<br>

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

There are two main types of relationships in Kozmik, single and multiple relationships.

#### Single relations (One-to-Many)

This means that one record has a relationship with multiple other records in a different Table.  For example, a single product can have a single category.

#### Multiple relations (Many-to-Many)

This means that records from both tables can link to multiple records from another table. For example, it's possible that a single product can have multiple categories.

<br>

### Lookup

The Lookup allows you to pull record contents of the linked record into a new column through the relation column. For example, let's say you want to see the description of a category on the Product Detail screen. To do this, you must first add a relation column that uses the Category table on the Product table. Then, you can add a Lookup column using this relation for the description field.

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


---

# 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.kozmik.io/tables/relations-and-lookups.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.
