# Configure a subscription

{% hint style="success" %}
**Prerequisite** \
You have created a new subscription, as explained in [↗ Broker details -> Create new subscription](https://docs.buildings.ability.abb/collection/english-v14/connectivity-as-a-service/connect-devices-with-abb-buildingpro/configure-client#neue-subscription-erstellen) above.
{% endhint %}

## Overview

<div data-full-width="true"><figure><img src="https://content.gitbook.com/content/Nyvwhz1kEMXcHf4HLuZ8/blobs/9TfB6vpqxjkjEolYGMII/DocsConnection%20Neue_Subscription.png" alt=""><figcaption><p>Fig. 1 – Creating a new subscription</p></figcaption></figure></div>

<table><thead><tr><th width="84.33333333333331">Icon</th><th>Description</th><th>Details</th></tr></thead><tbody><tr><td><strong>[A]</strong></td><td>Topic preview</td><td>In this section you see a preview of the incoming data</td></tr><tr><td><strong>[A1]</strong></td><td>Entering the topic preview</td><td>Enter an MQTT topic here. Its data will appear in the preview. <br><br>Important: In this field, you enter <strong>NOT</strong> the topic for which you want to create a subscription – this is done in <strong>[C]</strong></td></tr><tr><td><strong>[B]</strong></td><td>Name</td><td>Give the subscription a name. The subscription will be displayed under this name in the subscription list (in the broker details)</td></tr><tr><td><strong>[C]</strong></td><td>Topic</td><td>Enter the MQTT topic here for which you want to create a subscription.</td></tr><tr><td><strong>[D]</strong></td><td>QoS (Quality of Service)</td><td>Select a value. QoS indicates the level of message delivery between the MQTT broker and the connected clients</td></tr><tr><td><strong>[E]</strong></td><td>One or more formats</td><td>Choose whether a single format or multiple formats should be applied to the data. -<a href="#ein-oder-mehrere-formate">> One or more formats</a></td></tr><tr><td><strong>[F]</strong></td><td>Create format</td><td>If you want to define a new format, click here. The window opens <a href="../configure-a-format">↗ Format </a>configure</td></tr><tr><td><strong>[G]</strong></td><td>Select existing format</td><td>As an alternative to <strong>[F]</strong> you can also select an existing format</td></tr><tr><td><strong>[H]</strong></td><td>Save</td><td>Click to save the subscription</td></tr></tbody></table>

## One or more formats

<figure><img src="https://content.gitbook.com/content/Nyvwhz1kEMXcHf4HLuZ8/blobs/MiDgK2HgVBqkkp5ffRzj/image.png" alt=""><figcaption></figcaption></figure>

Choose whether a single format or multiple formats should be applied to the incoming data.

◈ If you select *Single* the same format will be used for all incoming data.

◈ If you select *Multiple* select, you can differentiate the data processing – depending on *Topic*. This means: Within a subscription, different topics can be processed with different formats. For this, use **Pattern**to define which data belongs to which format.

**Example:**

You subscribe to the topic `levels/+`.\
There are two actual topics:

* `levels/level1` → this data should be processed with **Decoder A** be processed
* `levels/level2` → this data should be processed with **Decoder B** be processed

Then in Multiple mode, enter two pairs:

| Pattern         | format    |
| --------------- | --------- |
| `levels/level1` | Decoder A |
| `levels/level2` | Decoder B |

▷ This way, the data is automatically decoded with the appropriate format depending on the topic.<br>


---

# 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.buildings.ability.abb/collection/english-v14/connectivity-as-a-service/connect-devices-with-abb-buildingpro/connect-devices-via-mqtt/configure-a-subscription.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.
