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

# Editing and deleting

> Change a data type's fields, or delete a data type you no longer need.

> [!NOTE]
>
> Required permission:
>
> * View data type
> * Edit data type to edit, Delete data type to delete

## Edit a data type

On **Data Type**, open **More actions** (**⋯**) on a data type's row and choose **Edit**. The web app first asks **Edit this data type?** because changing its fields may affect existing records. Click **Continue**.

![Editing a data type](https://mintcdn.com/mile-app/JlYib2YfcGFk65pR/images/v4/workflow/data/data-type-form.png?fit=max\&auto=format\&n=JlYib2YfcGFk65pR\&q=85\&s=815a4a9f5c2a6acafe7f6511c8f6aad0)

### Editing an older data type

A data type set up in the older version opens like any other, with a **What's new** link beside **Scope Data by User**. Saving it keeps it working in the older version, unless you add a feature only this version supports: a **Checkbox**, **Multi option** or **Relation** field, **Unique**, **Unique together**, or a field rule. Those show a warning icon, and **Save** asks first. See [Older data types](https://docsy3.mile.app/pages/workflow/data-type/introduction.md#older-data-types).

This page has the same layout as the New Data Type page, plus a **Related records** box when another data type links here.

1. **Name**: rename the data type. The name of a Master Data type follows its entity and can't be changed.
2. **Scope Data by Hub**: you can turn it on or off only while the data type has no records. Once any record exists it is locked, with the message *Records already exist, so this can no longer change.* On a Master Data type it follows the entity: users and vehicles are scoped by hub, hubs and roles are shared by all hubs.
3. **Scope Data by User**: turn it on or off. Turning it off asks **Turn off Scope Data by User?**, because it resets the access restriction on every existing record.
4. **Add Field**: add a field. Existing records get the new field empty.
5. Expand a field to change its label, type, rules and switches, as in [Creating a data type](https://docsy3.mile.app/pages/workflow/data-type/creating-a-data-type.md#set-up-a-field). Drag a row to reorder the fields.
6. **Add combination**: add or remove [unique together](https://docsy3.mile.app/pages/workflow/data-type/creating-a-data-type.md#unique-together) combinations.
7. **Cancel** or **Save**. If you leave with unsaved changes, the web app asks **Discard unsaved changes?**; click **Discard changes** or **Keep editing**.
8. **Related records**: choose which linked data types show their records on this one.

Things to know when editing:

* **Removing a field** asks **Remove this field?**. If records already hold a value in that field, the message tells you how many records have a value. The values are deleted when you save, and this can't be undone.
* The **Title** can be relabelled but not removed. Its bin says *The identifier field names every record, so a data type always keeps it.*
* A **Relation** field's target and relationship can't change. Delete the field and add a new one instead.
* On a **Master Data** type (User, Hub, Vehicle, Role), you edit only the fields you added. Its built-in fields can't be changed.
* On the sample data types **Customer** and **Product** that come with a new organization, the fields they were created with are locked (shown with a lock): only their description can change, and they can't be removed. You can add your own fields next to them.

## Delete a data type

Open **More actions** (**⋯**) on the data type's row and choose **Delete**.

![Delete data type confirmation](https://mintcdn.com/mile-app/JlYib2YfcGFk65pR/images/v4/workflow/data/data-type-delete.png?fit=max\&auto=format\&n=JlYib2YfcGFk65pR\&q=85\&s=74415092e8094d9bc11469fd2936e90c)

The dialog asks **Delete Store?** (with the data type's name). If another data type's Relation field still points at this one, the dialog says so as soon as it opens, naming that data type and field. Otherwise click **Delete** to confirm. If the data type already has records, the message warns that deleting it removes the data type **and all of its records**. This can't be undone.

A data type can't be deleted while something still uses it. The web app shows **Can't delete this data type** and lists what uses it:

* **Flow**: a flow that fills its fields from this data type.
* **Automation**: an automation that creates or updates its records.
* **Data type**: another data type with a Relation field pointing here, and which field.

Remove or change those first, then delete it again. Click **OK** to close the message.

These data types can't be deleted; their **Delete** item is greyed out:

* The **Master Data** types: User, Hub, Vehicle and Role. Hover **Delete** to see *Master Data cannot be deleted.*
* The sample data types **Customer** and **Product**, as long as they still have every field they were created with. Hover the greyed-out **Delete** to see *The Customer data type is a system default and cannot be deleted.*


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.