# How to get MQTT Topic in rule triggered by mqtt trigger channel?

**URL:** <https://community.openhab.org/t/how-to-get-mqtt-topic-in-rule-triggered-by-mqtt-trigger-channel/146649>\
**Category:** Beginners\
**Tags:** javascript, zigbee2mqtt, openhab3, trigger-channel\
**Created:** [May 12, 2023, 2:57pm UTC](https://community.openhab.org/t/how-to-get-mqtt-topic-in-rule-triggered-by-mqtt-trigger-channel/146649 "2023-05-12T14:57:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [May 12, 2023, 3:16pm UTC](https://community.openhab.org/t/how-to-get-mqtt-topic-in-rule-triggered-by-mqtt-trigger-channel/146649/2 "2023-05-12T15:16:48Z")

</div>

In the Event Channel set the “Separator Character”. As the description says

> The trigger channel payload usually only contains the received MQTT topic value. If you define a separator character, for example ‘#’, the topic and received value will be in the trigger channel payload. For example: my\_topic#my\_received\_value.

For a Nashorn example of this in use see [MQTT Event Bus Subscription [3.2.0;3.4.9]](https://community.openhab.org/t/mqtt-event-bus-subscription-3-2-0-3-4-9/127996) and for a GraalVM example see [MQTT Event Bus [4.0.0.0;5.9.9.9]](https://community.openhab.org/t/mqtt-event-bus-4-0-0-0-4-1-0-0/144238).

---

_[View the full topic](https://community.openhab.org/t/how-to-get-mqtt-topic-in-rule-triggered-by-mqtt-trigger-channel/146649)._
