# Dynamically changing debug node's name

**URL:** <https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539>\
**Category:** General\
**Created:** [13 November 2022 16:46 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539 "2022-11-13T16:46:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 November 2022 16:46 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/1 "2022-11-13T16:46:31Z")

</div>

This was discussed here [https://discourse.nodered.org/t/auto-name-debug-node-with-some-serialization-with-an-option-to-override-the-name/53926](https://discourse.nodered.org/t/auto-name-debug-node-with-some-serialization-with-an-option-to-override-the-name/53926)

I know debug nodes are now given a name "Debug n" but was the ability to change the name dynamically ever implemented?

Sometimes it is desirable to display two properties of a message in the debug pane, this would allow economy of debug pane space - from this  
 ![Untitled 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/412b956277f09eba6a418133bf139f74f3e52279.jpeg)  
to this (using msg.payload.device as the debug node's name)  
 ![Untitled 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/4123dae5b5ad8276117553ec1a27cef0e00bbd56.jpeg)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 November 2022 16:57 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/2 "2022-11-13T16:57:03Z")

</div>

> [@jbudd](#):
>
> but was the ability to change the name dynamically ever implemented?

No. Node names are not dynamic.

We already display the value of msg.topic in the top left of the message which would appear to satisfy your requirement to be able to show two message properties within the confines of what's already there.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 November 2022 17:12 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/3 "2022-11-13T17:12:41Z")

</div>

Thanks @knolleary.  
_msg.topic doesn't achieve the same thing in this case because these are elements of a single message from mqtt - so they share a msg.topic._ Edit - nonsense!

I can use a switch on msg.payload.device with multiple hard-coded and appropriately named debug nodes "Paint mixer", "Target colour", etc.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 November 2022 17:22 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/4 "2022-11-13T17:22:43Z")

</div>

Or you can set msg.topic to whatever you want before it reaches the debug node.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [13 November 2022 20:34 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/5 "2022-11-13T20:34:22Z")

</div>

Why not configure the `debug` node like this?

```auto
[{"id":"e5f991e0ac85021b","type":"inject","z":"c3b4e23e95193f6b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"hex\":\"ff5c00\",\"device\":\"paint mixer\"}","payloadType":"json","x":250,"y":400,"wires":[["595249a4a22101a1"]]},{"id":"595249a4a22101a1","type":"debug","z":"c3b4e23e95193f6b","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"msg.payload.device & \":\" & msg.payload.hex","targetType":"jsonata","statusVal":"","statusType":"auto","x":380,"y":400,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 November 2022 20:50 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/6 "2022-11-13T20:50:29Z")

</div>

Thanks for the suggestion.  
Actually it's not for a paint mixing machine but trying to debug interaction between individual RPi / ESP connected neopixels (Christmas is coming!).  
If msg.payload is a hex colour code, the debug output includes a colour swatch, as you see in the original post.  
If payload concatenates the device name and hex code, the swatch is lost, so no good for this application.

@knolleary's suggestion of changing msg.topic is (of course) the best dynamic solution

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [13 November 2022 21:19 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/7 "2022-11-13T21:19:51Z")

</div>

Debug node is for debugging, you should consider a dashboard/dedicated web interface instead ?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 November 2022 21:39 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/8 "2022-11-13T21:39:38Z")

</div>

Yes. Got one of them. A bit of a clue in the name I suppose. This is for debugging.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [13 November 2022 21:45 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/9 "2022-11-13T21:45:43Z")

</div>

> [@jbudd](#):
>
> the debug output includes a colour swatch

I completely missed that. How do you get that to happen? It doesn't seem to work for me.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 November 2022 22:14 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/10 "2022-11-13T22:14:29Z")

</div>

It only works if msg.payload is a string "#xxxxxx". An inject node #ff00ff works for me, but in some circumstances eg output from exec node I have to pass it through a function to lose a trailing carriage return.

> msg.payload = msg.payload.trim();

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [14 November 2022 01:01 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/11 "2022-11-14T01:01:13Z")

</div>

Nice. I didn't know it could do that. I left out the #, thinking it wouldn't matter. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 November 2022 01:01 UTC](https://discourse.nodered.org/t/dynamically-changing-debug-nodes-name/70539/12 "2022-11-28T01:01:18Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
