# How to iterate over multiple tag topics?

**URL:** https://discourse.nodered.org/t/how-to-iterate-over-multiple-tag-topics/70879
**Category:** General
**Tags:** function-node, mqtt
**Created:** [19 November 2022 16:12 UTC](https://discourse.nodered.org/t/how-to-iterate-over-multiple-tag-topics/70879 "2022-11-19T16:12:47Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [21 November 2022 14:15 UTC](https://discourse.nodered.org/t/how-to-iterate-over-multiple-tag-topics/70879/9 "2022-11-21T14:15:29Z")

</div>

OK, now we have some clarity. When you talk about tags you mean messages containing data for a tag, where the tag id is in msg.payload.tagName.

> [@Pari](#):
>
> there must be a way to pass the tag’s topic to the flow dynamically.

Do you mean you want to dynamically configure an MQTT In node to subscribe to a particular topic?

If so then you can do that via dynamic subscription as described in the help text for the MQTT node. This post gives examples of how to use it [Dynamic MQTT node's "actions-\>connect" guidance needed](https://discourse.nodered.org/t/dynamic-mqtt-nodes-actions-connect-guidance-needed/58878)

---

_[View the full topic](https://discourse.nodered.org/t/how-to-iterate-over-multiple-tag-topics/70879)._
