# Creating and modifying data models

## Create data model

To create **a new data model**, right-click on an empty space in the designer field and select *`Create empty model`*. Enter a title (required) and description (optional). Click *`Save`*. A new model has appeared in the designer's field.&#x20;

To **delete a data model**, right-click on it and press *`Delete`*.

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgldvlT-K8bgfMsIb3x%2F-Mgle5CrD9asbVGDjP9-%2F1-create_model.gif?alt=media\&token=7545fe6e-80a4-442c-9b0f-8495c7727f7f)

## Create data model field&#x20;

To create **a new field**, point to the "+" at the bottom of the data model and click the *`Add field`* caption that appears.&#x20;

A modal window will open with the settings for the new model:

* **Field name** — (required);&#x20;
* **Field type** —  (required; see the list of data types);
* **Description** — (optional);
* **Multiple values (Array)** — whether the field will be an array;
* **Not null** — the field will be required when creating an object;
* **Unique** — the field value must be unique for each object;
* **Index** — the field needs to be assigned an index (this will speed up the search in your database, but will increase its volume).

Click *`Save`* to save your changes. The field name and its type will be displayed in the data model.

To **delete a field**, right-click on it and press *`Delete`*.

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-MgldvlT-K8bgfMsIb3x%2F-MgleJQt1P_FLrZdL1kQ%2F2-create_field.gif?alt=media\&token=d496b982-c16b-4bb5-b5cf-55d35cee73e3)

## Related items&#x20;

### Business process blocks&#x20;

Each data model, when created, adds its own **blocks of business processes**. AppMaster Studio will automatically place them in the following block groups:&#x20;

* Model function - Model\_name;&#x20;
* Models.&#x20;

**Example:**&#x20;

Create a data model, name it **My\_model**.

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-Mh-mNdlTnFk_7771eS8%2F-Mh-nXG5BLtsHBvwM_QM%2Fimage.png?alt=media\&token=c1e11158-f7bc-41db-82f9-9a43a10cf576)

Go to the business process editor. In the general list, you will see the blocks of the model you created, the name of each of them will necessarily contain "My\_model".

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MapxHzVskQ_27pNUTT4%2F-Mh-_nt4mxqmHPdaH2Rr%2F-Mh-lHTZYbGT4djgP4bt%2Fimage.png?alt=media\&token=20155c89-57ff-45de-881f-a71766e35064)


---

# 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://appmaster.gitbook.io/docs/data-design/data-models-designer/creating-and-modifying-data-models.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.
