# Configuring the context bar

> Most of the dashboards in **TemplateOne** have a context bar at the top that displays context information and KPI's. You can configure the elements in the context bar. **TemplateOne** supports up to 6 elements, that can be configured in the HTML panel. See also [HTML Panels](https://docs.uipath.com/process-mining/standalone/2021.10/user-guide/html-panels#html-panels).

## Introduction

Most of the dashboards in **TemplateOne** have a context bar at the top that displays context information and KPI's. You can configure the elements in the context bar. **TemplateOne** supports up to 6 elements, that can be configured in the HTML panel. See also [HTML Panels](https://docs.uipath.com/process-mining/standalone/2021.10/user-guide/html-panels#html-panels).

You can configure more than 6 elements. However, this may affect the readability of the context information.

To add a context bar to a new dashboard you can copy the code in the **Expression** from an existing dashboard and change the configuration.

## Configuring the context bar

The configuration consists of setting the number of elements and the individual elements.

### Setting the number of elements

Follow these steps to change the number of elements in the context bar.

| Step | Action |
| --- | --- |
| 1 | Click on the expression in the **Expression** field in the **General** panel to edit the expression. |
| 2 | Set the integer in the `Number_of_KPIs` variable to the number of elements you want to display in the context bar. |

See the illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-53932-47b2c4be-b065f877.webp)

```
var Number_of_KPIs            := 3;
```

:::note
If you enter a higher number than the number of elements that you configure, the elements will show nothing but will take up space in the context bar.
:::

### Configuring the individual elements

The configuration of the individual elements consists of setting a number of variables.

| Element | Description |
| --- | --- |
| KPI_*n*_title | The name of the element or KPI to be displayed on the context bar. |
| KPI_*n*_present | The actual metric computed to be shown for the selected period. |
| KPI_*n*_comparison | The comparison metric that is shown next to the actual metric. Usually, this is a metric containing data outside of the selected period. |
| KPI_*n*_higher_is_better | The value that determines if an increase for the KPI should be considered to be an improvement. This influences the color or the comparison KPI: green - better, red - worse. |
| KPI_*n*_action | The action that makes the element clickable. By default, actions are not used, but the option to have this configured is available. |

See the illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-53808-ee14eb65-653243d8.webp)

### Example

```
// KPI 1
var KPI_1_title             := 'Average throughput time';
var KPI_1_present            := metric(Metric_cases_average_throughput_time, filter(records, activeperiodfilter));
var KPI_1_comparison        := metric(Metric_cases_average_throughput_time, filter(records, not activeperiodfilter));
var KPI_1_higher_is_better    := false;
var KPI_1_action            := Action_analyze_total_case_value;
```

## Advanced configuration

You can add a context bar to a new dashboard or you can add additional KPIs to the context bar.

### Extra period

Make sure that you enable an *Extra period* if you create another bar on a dashboard or copy one of the existing bars.

Follow these steps to add an extra period.

| Step | Action |
| --- | --- |
| 1 | Open **TemplateOne** in your developer environment. |
| 2 | Go to the dashboard for which you want to configure the context bar. |
| 3 | Click on the context bar. |
| 4 | Go to the HTML panel tab. |
| 5 | Click on `none`in the **Extra period** field in the **General** panel and select the extra period. |

See the illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-54024-91208d85-6513a40b.webp)

### Ading additional elements

If you want to configure more than 6 elements for the context bar, you must copy the set of elements and adapt these for each new element. You must also copy and adapt the code for each new element and add it to the list of KPI's at the end of the expression. See the illustration below.

![docs image](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-docs-image-54540-3c37b2ca-6ae106e2.webp)

:::note
For the **Details - Case Overview** dashboard the construction of the context bar is slightly different but based on the underlying structure defined for KPI_*n**title and KPI**n*_present. Here, the **Extra period** is also not used, hence it is removed from the template.
:::
