---
title: Creating custom tables
related:
  - https://docs.kentico.com/13/developing-websites/retrieving-content.md
  - https://docs.kentico.com/13/custom-development/extending-the-administration-interface/developing-form-controls.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

There are two applications related to custom tables:

- **Custom tables** – allows you to create new custom tables, for users with the Global administrator [privilege level](https://docs.kentico.com/13/managing-users/user-management.md). You can also view and manipulate data in existing tables.
- **Custom table data** – allows you to view and manipulate data in existing custom tables.

Note that you can only create new custom tables using the wizard in the **Custom tables** application. There is currently no simple way of creating custom tables using the API. This is due to the need to create related objects and settings (these tasks are handled by the wizard).

## Creating a custom table

Follow the example to create a new custom table using the **New custom table wizard**.

### Starting the New custom table wizard

1. Open the **Custom tables** application.
2. Click **New custom table**. A **New custom table wizard** starts.

### Step 1

1. Enter the following details:
   - **Custom table display name**: People
     - The display name is used for the table in the administration interface.
   - **Namespace**: customtable
   - **Name**: people
     - The code name is the table's unique identifiers. The name is always preceded by a Namespace, which allows you to have different tables of the same name in different contexts.
2. Click **Next**.

![Entering the details of the new custom table](https://docs.kentico.com/docsassets/13/creating-custom-tables/step1_entering_display_and_code_name.png "Entering the details of the new custom table")

### Step 2

Specify the details of the database table that the custom table uses.

1. Choose **Create a new database table**.
2. Leave the value _customtable\_people_ in the **Database table name field**.

   - **Create a new database table** – choose this option to create a brand new table in the system's database.
     - **Database table name** – the actual name of the table in the system database. A name in the _\__ format is pre-filled automatically.
     - **Primary key name** – primary key column name, pre-filled with the _ItemID_ value.

   - **Use an existing database table** – choose this option if you already have a physical table in the system database and want to register it in the system.
     - **Database table name** – the actual name of the table in the system database. The drop-down list offers only database tables which are not part of the default Xperience database schema and are not yet registered for any object.
     - **Primary key name** – primary key column name. The original table's primary key column is used automatically. Note that this column needs to be an identity column as well.The following check boxes allow you to choose the default fields that you want to include in the custom table:

   - **Include ItemGUID field** – globally unique ID of the particular custom table data record. Note that this field is mandatory if you want to [stage the table's data](https://docs.kentico.com/13/deploying-websites/content-staging.md) to a different instance of Xperience.

   - **Include ItemCreatedBy field** – user name of the user who created the item.

   - **Include ItemCreatedWhen field** – date and time of when the item was created.

   - **Include ItemModifiedBy field** – user name of the user who last modified the item.

   - **Include ItemModifiedWhen field** – date and time of last modification.

   - **Include ItemOrder field** – order of the item when table content list is displayed. The lower number, the earlier position in the list.
3. Make sure all the check boxes are enabled.
4. Click **Next**.

![Specifying the details of the database table](https://docs.kentico.com/docsassets/13/creating-custom-tables/step2_table_name_and_fields.png "Specifying the details of the database table")

### Step 3

The third step contains a [field editor](https://docs.kentico.com/13/custom-development/extending-the-administration-interface/developing-form-controls/reference-field-editor.md), which lets you define the columns in the database table.

Create the following fields to follow this example:

1. Create a field using the **New field** button with the following properties:

   - **Field name:** FirstName
   - **Data type:** Text
   - **Size:** 100
   - **Required:** Yes (select the check box)
   - **Field caption:** First name
   - **Form control:** Text box
2. Click **Save**.
3. Create a second field using **New field** with the following properties:

   - **Field name:** LastName
   - **Data type:** Text
   - **Size:** 100
   - **Required:** Yes (select the check box)
   - **Field caption:** Last name
   - **Form control:** Text box
4. Click **Save**.
5. Create a third field using **New field** with the following properties:
   - **Field name:** DateOfBirth
   - **Data type:** Date
   - **Required:** No (leave the check box cleared)
   - **Field caption:** Date of birth
   - **Form control:** Calendar
   - **Editing control settings -> Edit time:** No
   - **Editing control settings -> Show 'Now' link:** No
6. Click **Save**.
7. Click **Next**.

![Creating fields for the custom table](https://docs.kentico.com/docsassets/13/creating-custom-tables/step3_creating_fields.png "Creating fields for the custom table")

### Step 4

Select the sites where you want to make the custom table available:

1. Click **Add sites**. A dialog box opens.
2. Choose the site to which you want to add the custom table.
3. Click **Next**.

### Step 5

The last step gives you an overview of the tasks executed by the wizard.

**Finish** the wizard. The system redirects you to the **General** tab of the custom table that you created.
