---
title: Custom data
description: "Add fields of your own (metafields) to products, variants, collections, customers, orders, pages, blogs, blog posts and the store, edit and delete them, and fill in the store's own values."
---

**Custom data** lets you store information RetailPrime has no box for, such as what a sock is knitted from. A **metafield definition** adds a field of your own to one kind of record; every record of that kind then has the field in its **Metafields** card. A **metaobject definition** is a kind of record of your own, such as a sock designer: [Metaobject definitions](/settings-and-apps/metaobject-definitions) covers those.

## The Custom data page

In **Settings**, press **Custom data**. The page says **Fields of your own on your store's records, and records of your own.**

- **Metafield definitions** lists the nine kinds of record (**Records**) with how many **Definitions** each has: **Products**, **Variants**, **Collections**, **Customers**, **Orders**, **Pages**, **Blogs**, **Blog posts** and **Store**.
- **Metaobject definitions** lists your own record types; a new store has **No metaobject definitions yet**.

![The Custom data page: the nine kinds of record with 0 definitions each, and No metaobject definitions yet with Add metaobject definition](/screenshots/settings/160-custom-data.jpg)

## Add a metafield definition

Press a kind of record, here **Products**. The page **Products metafields** says **Definitions of the fields products can have.** At first: **No definitions yet**.

![The Products metafields page with No definitions yet and Add definition](/screenshots/settings/161-products-definitions-empty.jpg)

1. Press **Add definition**. The page **Add products definition** opens.

   ![The empty Add products definition page: Name, Namespace custom, Key, Description, Type Single line text, List of values, Minimum length, Maximum length, Choices, Storefronts, and Save](/screenshots/settings/162-add-definition.jpg)

2. Fill in the first card:

| Box | What to type | Example |
| --- | --- | --- |
| **Name** (required) | The field's name, as staff see it | `Fabric` |
| **Namespace** (required) | Starts as `custom`; leave it | `custom` |
| **Key** (required) | **Made from the name until you change it.** Themes use it | `fabric` |
| **Description** | Shown under the field on each record | `What the socks are knitted from.` |

3. In **Type and validations**, choose the **Type**: the kind of value the field holds. Type in the list to find one.

   ![The Type list open: Single line text, Multi-line text, Rich text, Integer, Decimal, True or false, Date, Date and time, URL](/screenshots/settings/163-definition-types.jpg)

| Type | Holds |
| --- | --- |
| **Single line text**, **Multi-line text**, **Rich text** | Text |
| **Integer**, **Decimal** | A number |
| **True or false** | A tick box |
| **Date**, **Date and time** | A day, or a day and time |
| **URL**, **Link** | A web address; a link also has its own text |
| **Color** | A colour |
| **Money** | An amount in the store currency |
| **Weight**, **Dimension**, **Volume** | A number with a unit |
| **Rating** | A score on a scale you set |
| **JSON** | Data for developers |
| **Product**, **Product variant**, **Collection**, **Page**, **File**, **Metaobject** | One of your products, variants, collections, pages, files or [metaobject entries](/settings-and-apps/metaobject-definitions) |

   Tick **List of values** to let the field hold several values instead of one.

4. Fill in the type's **validations** (the rules a value must follow). They change with the type. For **Single line text**: **Minimum length**, **Maximum length** and **Choices** (**One choice per line; the value must be one of them.**). Here the choices are `Cotton`, `Wool` and `Bamboo`.
5. Under **Access**, tick **Storefronts** if your theme should show it: **Themes and the Storefront API can read these values.** (Customers and Orders fields have no Storefronts box.)

   ![The Add products definition page filled in: Fabric, custom, fabric, the description, Single line text, the three choices, and Storefronts ticked](/screenshots/settings/164-definition-filled.jpg)

6. Press **Save**. The definition's page opens with its name as title. **Namespace**, **Key** and **Type** are greyed out: **Cannot change after saving.** and **The type cannot change after saving.**

   ![The Fabric definition's page with the namespace, key and type greyed out, and Delete at the top](/screenshots/settings/165-definition-saved.jpg)

Some types need their validations. A **Rating** without its scale is refused: **A rating needs scale_min and scale_max.** Fill in **Scale minimum** and **Scale maximum** (here `1` and `5`) and press **Save** again.

![The Add products definition page for Warmth, Rating, with the red message A rating needs scale_min and scale_max. and empty Scale minimum and Scale maximum](/screenshots/settings/166-rating-refused.jpg)

With **List of values** ticked, the validations are **Fewest values** and **Most values**. Here **Matching socks** holds a list of products:

![The Add products definition page for Matching socks: Product, List of values ticked, Fewest values and Most values](/screenshots/settings/167-list-definition.jpg)

## The definitions list

Press **Products** at the top to go back. Each definition shows its **Name**, **Namespace and key**, **Type** (with **List** for a list) and **Storefronts** under **Access** when themes can read it. Press a name to open it.

![Products metafields: Fabric (custom.fabric, Single line text, Storefronts), Matching socks (Product, List) and Warmth (Rating)](/screenshots/settings/168-products-definitions.jpg)

## Fill in the values

Open a product (**Products** in the sidebar, then the product). Its **Metafields** card now has a box for each definition, with the description under it: a list of **Fabric** choices, **Add products** for **Matching socks**, and **Warmth** with **From 1 to 5.** Fill them in and press the product's **Save**.

![Wool Socks' Metafields card: Fabric Wool, Matching socks No products chosen. with Add products, and Warmth 5, From 1 to 5.](/screenshots/settings/169-product-values.jpg)

The other kinds of record have the same **Metafields** card on their pages (an order's has its own **Save metafields** button).

## Edit a definition

Open it from the list, change its **Name**, **Description**, validations or **Storefronts**, and press **Save**. Here the **Fabric** choices get a fourth one, `Silk`.

## Delete a definition

1. Open it and press **Delete** at the top.
2. A window asks **Delete Warmth?** and says how many values go with it: **Its 1 value is deleted with it.** and **This cannot be undone.**

   ![The Delete Warmth? window: Its 1 value is deleted with it., Keep and Delete](/screenshots/settings/170-delete-definition.jpg)

3. Press **Delete**. You are back on the list without it.

## Every kind of record

Each kind of record has its own definitions page, made the same way. Examples for the sock shop:

| Records | Example definition | Type |
| --- | --- | --- |
| **Variants** | `Sock size` | **Single line text** |
| **Collections** | `Banner text` | **Single line text** |
| **Customers** | `Shoe size` | **Integer** |
| **Orders** | `Gift message` | **Multi-line text** |
| **Pages** | `Subtitle` | **Single line text** |
| **Blogs** | `Tagline` | **Single line text** |
| **Blog posts** | `Reading time` | **Integer** |
| **Store** | `Free delivery over` | **Money** |

![Variants metafields with Sock size, custom.sock_size, Single line text](/screenshots/settings/171-variants-definitions.jpg)

![Collections metafields with Banner text](/screenshots/settings/172-collections-definitions.jpg)

![Customers metafields with Shoe size, Integer](/screenshots/settings/173-customers-definitions.jpg)

![Orders metafields with Gift message, Multi-line text](/screenshots/settings/174-orders-definitions.jpg)

![Pages metafields with Subtitle](/screenshots/settings/175-pages-definitions.jpg)

![Blogs metafields with Tagline](/screenshots/settings/176-blogs-definitions.jpg)

![Blog posts metafields with Reading time, Integer](/screenshots/settings/177-blog-posts-definitions.jpg)

## The store's own values

The **Store** is a single record, so its values are filled in here rather than on a record's page. **Store metafields** has an extra button, **Edit store values**.

![Store metafields with Free delivery over (Money), and the Edit store values and Add definition buttons](/screenshots/settings/178-store-definitions.jpg)

1. Press **Edit store values**. The page **Store metafields** says **Values of the store's own fields, which themes can show.**
2. Fill in each box. A **Money** field is in the store currency: here **Free delivery over (PKR)** is `3000.00`.
3. Press **Save**. The page says **Store metafields saved.** To clear a value, empty its box and press **Save**.

![The Store metafields values page with Store metafields saved. and 3000.00 in Free delivery over (PKR)](/screenshots/settings/180-store-values.jpg)

## What's next

[Metaobject definitions](/settings-and-apps/metaobject-definitions): make a record type of your own, such as a sock designer.
