# Field Roles

## Basics

The Field Role function allows you to assign a role to individual database fields. The following roles are available:

* Primary
* Secondary

These roles are then used by widgets or lists to automatically display certain information from your sensors.

For example, in the device list, you now have the option of displaying the favorite values of a sensor directly in the table or using the new grid view to display each device as a map with all information.

## Setting Field Role

### Existing Field

Navigate into the database section of your Datacake device.

![](/files/x2EByNkUxI6nUj4KRRKr)

Now click on the dots button at the right end of a field row. This will open up a context menu where you have to click on "Edit Field".

<figure><img src="/files/ckPACp7PoAibn8AST1q1" alt=""><figcaption></figcaption></figure>

When you click on "Edit Field" this will open up a configuration modal where you can also set the Field Role. Click on "Role", this will open up a context menu that shows both available field roles. Simply select one and don't forget to press on "Update Field".

Now, you have the option to also select a Field Semantic, which will automatically generate some KPIs in your Device Overview. For more information about that, please refer to:

{% content-ref url="/pages/TmCOrosPLbxaXIz2OpLS" %}
[Field Semantics](/field-semantics.md)
{% endcontent-ref %}

### New Field

If you are creating a new database field, you have the option to directly set the field role.

## Using Field Roles

### Device List

Field roles can be used to display measured values of your sensor devices directly in the device list table.

All you need to do is activate which field roles you want to display on the field list. Click on "Columns" and simply select the field roles.

![Datacake Device List Field Roles](/files/FzjbI7VgWNSfzn7sUDua)

### Device Gallery

You can switch your device list from a table view to a grid layout that shows you all devices as cards in a gallery overview.

![Datacake Device Gallery View](/files/45v11X8ABe4osujQ2lNR)

Inside of Image map and map widgets, you can also display your device's primary or secondary fields, to give users a better overview on their devices.


---

# 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.datacake.de/device/database/fields/field-roles.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.
