> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kibocommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reference Field

> Learn how to use reference field in Kibo CMS.

The reference field enables users to link one content model to another. For instance, consider two content models, **Product** and **Category**.
A product may belong to multiple categories. In such a scenario, we create a reference field in the **Product** content model that refers to the **Category** model.

In this tutorial, we will learn how to use reference field.
As an example, we will use the **Product** content model that we created in the [Create Content Model](/pages/cms-create-content-model) tutorial.
We will create another content model **Category**, and give the reference of **Category** in **Product**.
We will do this in four steps:

* Step 1: Create a **Category** content model.
* Step 2: Add content entries to the **Category** content model.
* Step 3: Update the **Product** content model and add a category reference field to it.
* Step 4: Create a content entry in the **Product** content model with reference to the **Category** content model.

## Step 1: Create 'Category' content model

We will create a category content model with the following attributes and fields.

If you are not familiar with how to create a content model, please follow the [Create Content Model](/pages/cms-create-content-model) tutorial.

1. Create a content model with the following attributes:

   | Field               | Value                                                                          |
   | :------------------ | :----------------------------------------------------------------------------- |
   | Name                | **Category**                                                                   |
   | Singular API Name   | **Category**                                                                   |
   | Plural API Name     | **Categories**                                                                 |
   | Content model group | If you have created **E-commerce** group, select it, else select **Ungrouped** |
   | Icon                | **(boxes)**                                                                    |
   | Description         | **Demo Category content model**                                                |

2. Add the following field to the **Category** content model:

   | Field | Field Type |
   | :---- | :--------- |
   | Name  | Text       |

## Step 2: Create 'Category' content entries

1. From the **Side Menu**, Click **Content Modeling** > **Models**.

   > The **Content Models** screen opens.

   1. Hover over the **Category** content model.
   2. Click **View entries**.

2. Click **+ New Category**.

   > The **New Category** entry screen opens.

3. In the **Name** textbox, type **Clothes**.

4. Click **Save & Publish**.

   > The **Publish Product** confirmation screen appears.

5. Click **Yes, publish!**

   > The message "Clothes was published successfully!" displays.

**Optional**: Similarly, you can create another **Category** content entry with name **Accessories**.

## Step 3: Update 'Product' Content Model

1. From the **Side Menu**, Click **Content Modeling** > **Models**.

   > The **Content Models** screen opens.

2. Hover over the **Product** content model.

3. Click **Edit**.

   > Screen to configure the **Product** content model's fields opens.

4. Drag and drop the **Reference** field in the **Edit** tab.

   > **Field Settings - Reference** screen opens.

5. In the **Label** textbox, type **Category**.

6. In the **Content Models** dropdown, click **Category**.

7. Click the **Use as a list of references** button.

   **Note**: Since a product can belong to multiple categories, enabling **Use as a list of references** will allow you to associate multiple categories to a product.

8. Click **Save Field**.

   > Screen to configure the **Product** content model's fields opens.

9. Click **Save**.

   > The message "Your content model was saved successfully!" displays.

## Step 4: Create 'Product' content entry with a reference to 'Category'

1. From the **Side Menu**, Click **Content Modeling** > **Models**.

   > The **Content Models** screen opens.

   1. Hover over the **Product** content model.
   2. Click **View entries**.

2. Click **+ New Product**.

   > The **New Product** entry screen opens.

3. In the **Name** textbox, type **Men's Tiro '21 Pants**.

4. In the **Description** textbox, type **Men's tapered track pants for versatile wear**.

5. In the **Price** textbox, type **28**.

6. In the **Category** field:
   1. Click **Select an existing record.**

      > The **Select an existing record** screen opens.

   2. In the search bar, type **Clothes**.

   3. Click the **Clothes** list item.

   4. Click **Save**.

7. Click **Save & Publish**.

   > The **Publish Product** confirmation screen appears.

8. Click **Yes, publish!**

   > The message "Men's Trio '21 Pants was published successfully!" displays.
