# Editing the data model

## Data model editor

To access the data model editor, select "Data model" on the application's main screen in Eximee Designer

<figure><img src="/files/dae6497b4df58eb5bac268a090e15eaed27384e5" alt=""><figcaption><p><em><strong>Figure 1.</strong> "Data model" tab of the low-code application</em></p></figcaption></figure>

The data model editor is divided into three tabs:

* *Structure,* where we manage the model structure and fill in node parameters,
* *Data sources*, where we define and parameterize data sources,
* *Source*, where we edit the JSON that is the source representation of the model - functionality for advanced users.

{% hint style="info" %}
If your application does not yet have a data model, you can create one by clicking the "Initialize data model" button.
{% endhint %}

## Structure

The data model structure is presented as a tree in the left panel of the editor. Tree branches can be collapsed and expanded.

<figure><img src="/files/917a4bf2057a36893e16491320cc77c441d74ddf" alt=""><figcaption><p><em><strong>Figure 2</strong>. Presentation of the data model structure</em></p></figcaption></figure>

Selecting a tree node automatically filters the nodes on the list on the right.

<figure><img src="/files/88a6b85be5fc5ac95fdaa8cc747fa873388ec8d0" alt=""><figcaption><p><em><strong>Figure 3.</strong> Selecting a node in the data model editor</em></p></figcaption></figure>

At the top of the node list, the key constituting the current view filter is displayed: *"client.surname"* in this case.

## Parameterization of model elements

### Node

<figure><img src="/files/d5f5c111f8349254363487dd7d5863a359f64bce" alt=""><figcaption><p><em><strong>Figure 3.</strong> Editing a model node</em></p></figcaption></figure>

In the model node editing section, you can edit the key and documentation (*"description"*) of the object. You can also mark the object as an array.

{% hint style="info" %}
Next to the object key there is a button that copies the key to the system clipboard.
{% endhint %}

The context menu includes an option to delete the node together with its descendants.

To add a field to a node, click the *"Add field"*.

### Field

The field section in the data model also allows you to specify a default value for the field.

<figure><img src="/files/9a5ded4d5d9f4bf5f56e68b6e365507ae62daa7c" alt=""><figcaption><p><em><strong>Figure 4.</strong> Field in the model</em></p></figcaption></figure>

### Data source

Clicking the data source chip or the pencil icon next to it opens a drawer with a list of data sources and the ability to edit the use (source order, source parameters, value mapping).

<figure><img src="/files/8c06b698cee5eed8f0cd02fd3be879959e5f83ea" alt=""><figcaption><p><em><strong>Figure 5.</strong> Data source use</em></p></figcaption></figure>

By default, for each **leaf** of the data model tree (i.e., fields that do not have any further subfields), the platform automatically adds a special data source of type **ValueMap**. This is a built-in source that stores the field value in the application's memory structure (the so-called application value map) – it can be treated as an equivalent of a session variable storing data in the context of the entire application (form). The default ValueMap mapping uses the full key path of a given field as the key in this internal map (e.g., for the field `country` located inside the object `personalData` the key in the value map will be `personalData.country`). Thanks to this, after binding form fields to the model, **no additional code is required to save entered data** – the value entered by the user will be automatically placed under the appropriate key in the model memory.

#### Data source - defensive logic and empty values

Data model sources cannot assume a deterministic order of execution or that all input data is already available. The platform may call a source earlier (e.g., when determining the multiplicity of dynamic sections of the form or model), even if a given field is not yet used directly in the form or process.

Therefore, data sources must be designed defensively: in the absence of data, incomplete data, or data that is "not yet ready," they should return safe empty values (null, an empty list, an empty object) and not raise exceptions. An empty value means: at this stage I cannot determine the value, and it allows the next sources in the cascade to operate, especially default sources (e.g., ValueMap or default values on the field definition).

Exceptions should be reserved only for real technical errors (e.g., communication errors or incorrect configuration) that should interrupt system operation (form termination, process transaction rollback, etc.), not for transitional process states.


---

# 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://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/model-danych/edycja-modelu-danych.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.
