# Fields

## Overview&#x20;

In the Fields section you can define and manage the information that you want to see as result of a query. This section is divided into two areas - List of selected fields and collections of fields to add.&#x20;

![Definition of Fields in a query](/files/-MBE_eTaLheXurd6OSfc)

On the left-hand side is a list of selected fields from your Source and Query Context. Each entry is identified by its original **Field** name. You can define the **Position** - top to bottom means left to right in the result -, give the entry a **Title** and specify the **Order** about how the matching records should be sorted in the result. The column **Actions** offers you to edit, to delete and to position each entry in the list.

The right-hand side offers you collections of fields based on the **Main Query Class** definition selected by the Source and optionally based on the **Linked Class** definition selected by the Query Context in the Common attributes of the query. Lastly, the **Virtual Fields** section gives you access to the Script Configuration and any kind of constructed information you would need in the query result.

## Add a Field

To create the result of your query you need to add at least one field to the list of fields. Whether you choose a field of the Main Query Class, select a field of the Linked Class, or create a Virtual Field is equivalent. To add a field to your list of fields open the Class drop-down on the right-hand side. You can either tick the `All` checkbox at the top to choose all available fields in the Class or select multiple entities of the Class by setting a tick in front of the list element. Finally, click on **Add fields** to add them to the list of fields on the left-hand side.

![Adding a collection of fields from the Source](/files/-MBDs1UOpS3XDFmYCgRT)

Repeat this process until all requested fields have been added to the query. You can choose fields from the Main Query Class, the Linked Class or any Virtual Fields alike. More information on Virtual Fields is described in the [Scripting](/building-an-application/execution/scripting.md) article.

![Adding individual fields from Source and Query Context](/files/-MBEUz_VlslzhftdGYUX)

## Edit a Field

Under **Actions** of each field you have the ability to **Edit** <img src="/files/-MBCo7T7BtG64Zwffv31" alt="" data-size="line"> , **Delete** <img src="/files/-MBERLm_rQfmOyoGQJFV" alt="" data-size="line"> , and **Position** <img src="/files/-MBEACmVckVy-uZ1eKqH" alt="" data-size="line"> the selected row.&#x20;

Click on the **Edit** icon <img src="/files/-MBCo7T7BtG64Zwffv31" alt="" data-size="line"> to open a details view of the properties of the field.

<figure><img src="/files/lbWZ1Pj6unWa3raIi8mr" alt=""><figcaption><p>Editing Query Field</p></figcaption></figure>

On the **Query Field Properties** view you can enter and modify values for the field **Alias** (Title), Name (for translations in English and German language), choose the sorting order of records, and define where records with `NULL` (undefined) value should be located in the result.

{% hint style="info" %}
A query contains of at least one Field entry. This is compulsory to verify and validate the query.
{% endhint %}

## Edit a Linked Class

Despite same appearance of **Actions** of a Linked Class record in the list of fields a click on the **Edit** icon <img src="/files/-MBCo7T7BtG64Zwffv31" alt="" data-size="line"> opens the **Field Group Properties** view. Here you can define advanced features like *aggregation or inline* display of information of the field group.

![Review and edit properties of a Context](/files/-MBXE_gASBA8EXhB0LYH)

The section **Place** provides you with a drop-down to define the functionality of the Field Group. You can choose one of the following features:

* Aggregate
* Inline

Each functionality has additional, individual configuration options.

### Aggregate

A selection of most commonly used aggregate functions are available. Following options in the **Aggregation** drop-down are available.

* Sum
* Count
* Average
* Min
* Max

You can choose one option.&#x20;

![Available options of an aggregation](/files/-MBXFe3EBQuKciDh9sXZ)

Commonly an aggregation would be used to retrieve an information based on a numeric value, e.g. age of person, number of days, products in stock, etc.

### Inline

The Inline functionality offers you to display the record values of one or multiple fields of a Linked Class. Those records of a field are separated by semicolon.

![Multiple fields of the context are used as inline information in the result](/files/-MBXIahzEKUeQelyC3TP)

Several fields of a Linked Class are shown separated by comma within the record while multiple records are separated by semicolon.

## Delete a Field

To remove a row from the list of fields click on the **Delete** icon <img src="/files/-MBERLm_rQfmOyoGQJFV" alt="" data-size="line"> in the column Actions. Repeat to remove more than one row from the list.


---

# 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.tivity.one/building-an-application/data/query-data/query-designer-fields.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.
