# Lookup Tables

### Overview

The **Lookup Tables** are a way for you to store data that you can then use in **Templates**, **Flows** and **Journeys**. Create your Lookup Tables through the dashboard, and then dynamically reference data in these table

Lookup Tables in Bird store and centralize data references, which can be looked up when creating email templates using Liquid templating language in HTML.

For example, every country's flags, abbreviations, or currency can be stored and updated centrally as a lookup table. Every time it is used in building an email, it can be referenced from this lookup table.

> **Important limitaions:**
>
> * Each table can have up to 10 separate data items stored in it.
> * Each item may contain up to roughly 300kB of data.

## Create a Lookup Table

&#x20;Go to Content > Lookup Tables and click on Create.

* Enter a display name
* Enter a slug with no spaces

Note that this slug is used in referencing the email template

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd7CTdsd-vlhH0QwcIP_mw0qF4iTdiszeamcnDXYz1L7DiGc9FXtm-9Ffv-EIT5QBVr6TCUQ51Q70nYnfmG2MxvKJGTMTsliSFAPdVtjJOQgPlGXoaPE_mFbHljkpwrMHBWJiaCpQ?key=H_MNfPZffg3PtLyr7Xs2c_gr" alt="" width="563"><figcaption></figcaption></figure>

* Click on Save

### JSON Editor

* Once you have saved, you will see a JSON editor. You can select either the Text or UI editor based on your preference.
* Update the lookup table using a JSON structure.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXegJLbvo8NCRSt8LPdOVlPSnvuB_BiERD0InCoWI9J8dvX-exT4gMC3IWbumCInDbKsenvut0DA5u3c3jCjNJwuzTPcCeBJVWci7smJ7wTMEjDBHXhSDhVPDfIXtnGzwpxzujEg?key=H_MNfPZffg3PtLyr7Xs2c_gr" alt="" width="563"><figcaption></figcaption></figure>

### Adding an item

To add an item in a JSON for organization, click on +Add Item on the left pane.&#x20;

* Type a name on the top
* Click on Add Item button

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcAGdwXyftrIfiZbxT17V-CzlOq8LLwBS7RCrtvqyhTiDMiT1MEH87ytBGd7w3joA65Nloc1DDEIkfx__F-aW_LDb3imTHuhLD8qPTuTuefh0zx0eVOXQtAIT9LMw9g-JCiG3-twg?key=H_MNfPZffg3PtLyr7Xs2c_gr" alt="" width="563"><figcaption></figcaption></figure>

* Once created, you can see the item created on the left pane.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeuv4DegFlEw016BiK8p7GO0cr6VI93EK8kdcNFDs9wWjFCZ6NoYwfkRwq0QKAxj2J5KR-kCTjDzEE6_qzZuxyXZZU5WxA5CsP6UD18kr2FOuVH57uDCUaG8jx_rLgDwvQjrcdlkQ?key=H_MNfPZffg3PtLyr7Xs2c_gr" alt="" width="563"><figcaption></figcaption></figure>

### Write the JSON

Use the JSON format to define any object structure and key-value pairs below:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcxyxJiNnmS8MOZ4CtvQ_FABO6dTJUd9XD-EuQH6Tqq2FKPR5YnTl4xpG9HSOs3KWFddcEp9aEKVLgke-IShCce54w61T3Q8LiHY_Vta_EKY5aIdom8-HzzNhzfEproAwqUHAj1uw?key=H_MNfPZffg3PtLyr7Xs2c_gr" alt="" width="563"><figcaption></figcaption></figure>

For example, a JSON which gives countryname and local currency based on country abbreviation

`{`

&#x20;`"NL": {`

&#x20;  `"countryname": "Netherlands",`

&#x20;  `"local_currency": "EUR"`

&#x20;`},`

&#x20;`"US": {`

&#x20;  `"countryname": "United States",`

&#x20;  `"local_currency": "USD"`

&#x20;`}`

`}`

You can also use the UI editor to define the JSON structure.

The same example as above can be defined as:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXejtTNXjoLbkFk-4AZgjJ71jGaW-j8WXqR8HFf9iMVIEET7z2_OUNVaScA7w7NuKNsZzy3NJ3SNEYN0CnXhDC-1GMxa1XX8un2FGJ21aSJEII1NHmwAWkA-32ZTrJO8moU0R50v?key=H_MNfPZffg3PtLyr7Xs2c_gr" alt="" width="563"><figcaption></figcaption></figure>

## Use Lookup Table in Email Template

To use a lookup table in an email template, you can add the following liquid syntax to your HTML template or to an HTML element used in a drag-and-drop builder:

`{% assign variable_name = "lookup-table-slug" | lookup: "item-name", "object-value" %}`

`{{variable_name.key_name}}`

Here,

* **variable\_name** is any name you can define
* **lookup-table-slug** is the slug you have given when creating the lookup table
* **item-name** is the name of the item you have created
* **object-value** is the value you have given for the JSON item
* **key\_name** is the name of the key in the key-value pair defined under item-value<br>

For example,

To render the local currency of a defined country, we can use the below syntax

* **variable\_name** here is defined as currency (any name that the user can define)
* **lookup-table-slug** here is **country-flags** as defined when the lookup table was created
* **item-name** is the **country** as created earlier and shown in the left pane
* **object-value** is **AD,** which is the value defined in the JSO&#x4E;**.** Note that this can also be a variable
* **key\_name** is the local\_currency, which is defined in the JSON

`{% assign currency = "country-flags" | lookup: "country", "AD" %}`

`{{currency.local_currency}}`<br>

When used in the email template builder in an HTML block, the above syntax will render the value of the ***local\_currency*** as stored under the ***AD*** object under the country item in the lookup table **country-flags**<br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcc1WAW_ODpViPp_qphn4VrULXgxGENhk79bLbvinA5rzSJCGIh1uyiKFaJCv9ThW0BV07SKpf_Wkbw88brvScps_V1dWtzFNDrZOugnfASG3K5dwAzBEYGHxK5EF1fbvdUR2nxsA?key=H_MNfPZffg3PtLyr7Xs2c_gr" alt="" width="563"><figcaption></figcaption></figure>

\
You can switch to the preview section to see the output value displayed dynamically in the email template. Below, it is showing EUR as the value fetched from the look-up table.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXctqK4ouxmHn3vDwPsjfPEu0raTu1lzX9PrmCtzdVpAsHIItRqFaAHhvd7bXepBLNt5u_KlHBrolFlV2nw2nBoD-kXsItK9K5Ub1YTB-8rdtJLYxgE-K61u7Uel23WBeOyba3FrPQ?key=H_MNfPZffg3PtLyr7Xs2c_gr" alt="" width="563"><figcaption></figcaption></figure>

<br>


---

# 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.bird.com/applications/content/lookup-tables.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.
