# Lookup Table Designer

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2Fx9TItBen9vPtS3zbQyoL%2Fimage.png?alt=media&#x26;token=d6206af0-733f-40a6-b7f3-1960357ed339" alt="Lookup Table Overview"><figcaption><p>Lookup Table Overview</p></figcaption></figure>

### Editing and Saving Changes

When editing a Lookup Table, you can make changes directly in the table designer. Use the control buttons in the top-right corner to manage your edits:

* **Undo** ⟲ – reverts your last action
* **Redo** ⟳ – restores the reverted change
* **Save** 💾 – saves the current version of the table

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FGewRaNUf6NsWqT1Sbgs9%2Fimage.png?alt=media&#x26;token=b36548e4-a764-4dcf-ad81-3574a9f67465" alt="Lookup Table Overview"><figcaption><p>Save Controls</p></figcaption></figure>

These actions help you safely adjust the table before saving. Each time you save, a new snapshot of the Lookup Table is created and recorded in the **History** panel, where you can review or restore past versions.

{% hint style="info" %}
All changes are made to the current table version. Use rule versioning to maintain different states of your data.
{% endhint %}

### Table Structure

A Lookup Table consists of:

* **Columns**: Define the structure and schema of your data
* **Rows**: Contain the actual data values
* **Primary Key**: One column that uniquely identifies each row

#### Column Types

Unlike Decision Tables, Lookup Tables have a simpler column structure:

| Element              | Description                                 |
| -------------------- | ------------------------------------------- |
| **Column Name**      | The display name shown in the column header |
| **Primary Key Flag** | Indicates if this column is the primary key |
| **Order**            | Position of the column in the table         |

### Column Operations

#### Add Column

To add a new column, click the **+** button next to your rightmost column.

![Add Column](https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2F2MYKMWXlkz29zdIZo0LM%2Fimage.png?alt=media\&token=07306e81-7c4c-40b0-b372-9b8ed9a279b0)

{% hint style="warning" %}
You cannot add a new primary key column. If you need to change the primary key, you must create a new Lookup Table.
{% endhint %}

#### Rename Column

To rename a column, double-click on the column name in the header and type the new name. Press **Enter** or click outside the field to confirm. You can also find a rename option in the context menu when right-clicking a column header.

![Rename Column](https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FXbhog82cZHeeZTeyz1nE%2Fimage.png?alt=media\&token=0da5e694-234c-4be1-ab55-81a00d294ae5)

#### Reorder Columns

To change the position of a column:

1. Click and hold the column header
2. Drag the column to its new position
3. Release to drop

{% hint style="info" %}
The primary key column is always pinned to the left side and cannot be moved.
{% endhint %}

#### Delete Column

To delete a column:

1. Click the dropdown arrow (or right-click) in the column header
2. Select **Delete Column**
3. Confirm the deletion in the modal

{% hint style="warning" %}
The primary key column cannot be deleted.
{% endhint %}

### Row Operations

Multiple Row Edits

To Edit multiple rows hold **Ctrl** (or **Cmd** on Mac) and click to select multiple rows and right-click to open the context menu. Alternatively hold **Shift** and click on the first and last row headers of the range you wish to select.

#### Add Row

To add a new row, click the **+ Row** button in the bottom toolbar. A new row will be added at the end of the table with empty values.

New rows are also automatically added when pasting content from other spreadsheet editors or when importing CSV data

![Add Row](https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FXtEOB7NNH64lhzyb8ItD%2Fimage.png?alt=media\&token=054175b3-7b3e-4a8b-bbbb-21d524edcd82)

#### Copy Row

To duplicate a row:

1. Right-click a row header (or a group of headers)
2. Select **Duplicate Row**

The duplicated row will appear below the original. Remember to change the primary key value to maintain uniqueness.

#### Insert Row

To insert a row at a specific position:

1. Right-click a row header (or a group of headers)
2. Select **Insert Row Above** or **Insert Row Below**

#### Delete Row

To delete a row:

1. Right-click a row header (or a group of headers)
2. Select **Delete Row**

### Primary Key Validation

The Lookup Table Designer automatically validates primary key integrity:

#### Duplicate Detection

When you enter a primary key value that already exists in the table:

* The cell is highlighted in red
* A validation error appears
* You cannot save until the duplicate is resolved

![Duplicate Key and Empty Key Errors](https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FvQO0mYAm8bBwQoArZUNj%2Fimage.png?alt=media\&token=6ae96481-fa75-4535-8299-5146c0de29f5)

#### Empty Primary Key

Primary key cells cannot be empty:

* Empty primary key cells are highlighted
* A validation error appears
* The row with an empty primary key will not be saved

#### Error Navigation

When validation errors exist, use the **Error Navigator** in the toolbar to:

* See the total error count
* Navigate to the next/previous error
* Jump directly to specific error rows

![Error Navigator](https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FNgCRqfrlxZFt6OUUAhMT%2Fimage.png?alt=media\&token=a7498818-e4cf-4c44-8bc0-42ce318da233)

### Search

To search through your Lookup Table:

1. Find the input in the bottom bar
2. Select **Search**
3. Type your search term

The search will:

* Highlight matching cells in green
* Show the number of rows containing matches
* Allow navigation between matches using arrow buttons

![Search](https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FK8lteOwaxM5AeknWRL3v%2Fimage.png?alt=media\&token=5d2e9ce0-59e4-4b08-86fe-0ee1a562df90)

#### Go to Row

Alternative to the **Search** feature if you know the row number:

1. Click **'#'** icon in the input in the bottom bar
2. Enter the row number
3. Press **Enter**

The table will scroll to that row and highlight it.

### Performance Considerations

Lookup Tables are optimized for large datasets:

* **Virtual scrolling**: Only visible rows are rendered, enabling smooth performance with hundreds of thousands of rows
* **Efficient indexing**: Primary key lookups are O(1) complexity

{% hint style="info" %}
Lookup Tables can support up to **hundreds of thousands of rows** depending on your plan.
{% endhint %}

### Keyboard Shortcuts

| Shortcut        | Action                     |
| --------------- | -------------------------- |
| **Tab**         | Move to next cell          |
| **Shift + Tab** | Move to previous cell      |
| **Enter**       | Confirm edit and move down |
| **Escape**      | Cancel current edit        |
| **Ctrl + Z**    | Undo                       |
| **Ctrl + Y**    | Redo                       |
| **Ctrl + S**    | Save                       |
| **Ctrl + F**    | Open search                |
