# Format strings in name of a debug output

**URL:** <https://discourse.nodered.org/t/format-strings-in-name-of-a-debug-output/61485>\
**Category:** General\
**Tags:** debugging\
**Created:** [19 April 2022 10:43 UTC](https://discourse.nodered.org/t/format-strings-in-name-of-a-debug-output/61485 "2022-04-19T10:43:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![finlay\_morrison](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@finlay\_morrison](https://discourse.nodered.org/u/finlay_morrison)\
**Post date:** [19 April 2022 10:43 UTC](https://discourse.nodered.org/t/format-strings-in-name-of-a-debug-output/61485/1 "2022-04-19T10:43:51Z")

</div>

In the console output of a debug node the name of the node is printed, however I would like the name of the node to change with a changing input. I have already tried this by using a format string, shown below, however this does not change the output.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f253ccc4a355a19ed3c4ef90bc919a3bbbf0998d.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/41c4bcaabebe3747451703739eb38389bae85e53.png)

Alternativaly, a way to change the formatting of the console output for the debug messages would work too. Are either of these two things possible?

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [19 April 2022 11:26 UTC](https://discourse.nodered.org/t/format-strings-in-name-of-a-debug-output/61485/2 "2022-04-19T11:26:13Z")

</div>

I don't think you can change the name of the node like that.  
You could use JSONata in the debug node to customise the output:

```auto
[
    {
        "id": "999e43622e7fad88",
        "type": "inject",
        "z": "317b5175d0f9c970",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "topic",
        "payload": "",
        "payloadType": "date",
        "x": 240,
        "y": 100,
        "wires": [
            [
                "b068025607cad5db"
            ]
        ]
    },
    {
        "id": "b068025607cad5db",
        "type": "debug",
        "z": "317b5175d0f9c970",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": true,
        "complete": "\"this is the payload \"&payload &\" This is the topic \" &topic",
        "targetType": "jsonata",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 530,
        "y": 100,
        "wires": []
    }
]

```

---

<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:** [3 May 2022 11:26 UTC](https://discourse.nodered.org/t/format-strings-in-name-of-a-debug-output/61485/3 "2022-05-03T11:26:50Z")

</div>

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