> For the complete documentation index, see [llms.txt](https://docs.fabricplan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fabricplan.com/documentation/plan/powertable-sheets/how-tos/adding-columns-overview/add-visual-column/multi-select-relationship-column.md).

# Multi-select relationship column

A multi-select relationship column lets you associate one or more records from a lookup table with each record in the primary table. It uses a relation table to store the relationships between the primary and lookup tables, enabling many-to-many associations.

By retrieving values from a lookup table, multi-select relationship columns help maintain data consistency, reduce manual data entry, and ensure that users select only valid values.

In this article, you learn how to add a multi-select relationship column to a primary table and add column values that are fetched from the records in a lookup table.

### Prerequisites

Before creating a multi-select relationship column and configuring a many-to-many lookup, make sure that the following tables exist in the database:

* The primary table that contains a primary key and an identifier column.
* The lookup table that contains a primary key, an identifier column, and the selectable values.
* The relation table that contains an identity column and foreign keys that reference the primary key columns in the primary and lookup tables.

{% hint style="info" %}

#### Note

If the required tables do not exist in the database, create or import them to the database before configuring the multi-select relationship column.

You can import them using PowerTable from external sources such as Excel or CSV files. To learn more, see [this section](/documentation/plan/powertable-sheets/how-tos/create-a-table-app-with-powertable-sheets.md).
{% endhint %}

### Add multi-select column

In the following example, you'll add a *Sales Rep* multi-select column to the *Products* table so you can assign one or more sales representatives to each product.

This column retrieves column values from the *Sales Representatives* table (lookup table) using the relationship information obtained from the *Rel\_SalesRep\_Products* table (relation table).

To add a multi-select column:

1. Select **Insert Column** > **Visual Column** > **Add Multi-Select Relationship Column**.

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

2. Enter a name for the column in the **Column Name**.
3. Enter the lookup table details. This is the table from which the list of values for each record will be retrieved. Use the dropdown menus to select the items listed below.

* Lookup Table: *Sales Representatives*
* Lookup Value: *First Name*
* Lookup Key: *Sales Rep Key*

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

4. Specify the **relation table**, the **reference column** that stores the lookup table key, and the **identifier columns** used to match records between the primary table and the lookup table. These mappings are used to establish and maintain the relationship between the tables.

![](/files/cd2000c9ae8bd35c82306fe92edddc7197aae813)

Relation table details

This stores or updates the mapping between products and sales reps in the relationship table as we assign and unassign sales reps to the products in the app. Click **Save.**

### Review the multi-select relationship column

We have now successfully added a multi-select relationship column, which allows you to select and assign multiple sales representatives to each product.

![](/files/f9cadbf5d35ef6df250c0a4840d660089cc866c4)

Multi-select relationship column

After assigning, you can click **Save** and **Proceed** to save your changes to the database.

![](/files/597cfdb18df52bc6a74c30d57b2c559a47eaa714)

Save changes

The relation table is also simultaneously updated based on the selected values.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.fabricplan.com/documentation/plan/powertable-sheets/how-tos/adding-columns-overview/add-visual-column/multi-select-relationship-column.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
