# Character "/" don't appear in template

**URL:** <https://discourse.nodered.org/t/character-dont-appear-in-template/78151>\
**Category:** General\
**Created:** [3 May 2023 15:25 UTC](https://discourse.nodered.org/t/character-dont-appear-in-template/78151 "2023-05-03T15:25:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel2](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Gabriel2](https://discourse.nodered.org/u/Gabriel2)\
**Post date:** [3 May 2023 15:25 UTC](https://discourse.nodered.org/t/character-dont-appear-in-template/78151/1 "2023-05-03T15:25:44Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06b4e0fb286405fd70ec5eaaf98357e2a678447c.png)

I try use JSON.stringify and toString, but don't work.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [3 May 2023 15:56 UTC](https://discourse.nodered.org/t/character-dont-appear-in-template/78151/2 "2023-05-03T15:56:42Z")

</div>

Welcome to the forums @Gabriel2.

But I must state, its really not clear what your trying to achieve.

Sending `/` to a function node, running it through `JSON.stringify` & `toString` \<- unnecessary, as `JSON.stringify` does exactly that! Then running that through a template node - expecting what exactly?

Please! For your benefit, provide more information on what it is you want to achieve exactly.

Example - `/` is not valid JSON for starters, so is not _really_ suitable for `JSON.stringify`

**EDIT**  
If your want to actually print JSON in a template , then you need to escape it with 3 brackets, after using `JSON.stringify`

`{{{payload}}}`

---

<div class="post-metadata">

**Author:** ![Gabriel2](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Gabriel2](https://discourse.nodered.org/u/Gabriel2)\
**Post date:** [3 May 2023 16:57 UTC](https://discourse.nodered.org/t/character-dont-appear-in-template/78151/3 "2023-05-03T16:57:21Z")

</div>

I'm trying to pass a text that has "/" to a file through the 'template', but instead of getting "/" to the file it arrives &#x2F

```auto
[
    {
        "id": "2089aafc129801af",
        "type": "template",
        "z": "a124555c43bf7bf0",
        "name": "",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "This is the payload: {{payload}} !",
        "output": "str",
        "x": 1000,
        "y": 1000,
        "wires": [
            [
                "6e1d262a16c61631"
            ]
        ]
    },
    {
        "id": "18868541dbeae49a",
        "type": "inject",
        "z": "a124555c43bf7bf0",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "/",
        "payloadType": "str",
        "x": 590,
        "y": 1000,
        "wires": [
            [
                "c50542ca3d243520"
            ]
        ]
    },
    {
        "id": "6e1d262a16c61631",
        "type": "debug",
        "z": "a124555c43bf7bf0",
        "name": "debug 157",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1190,
        "y": 1000,
        "wires": []
    },
    {
        "id": "c50542ca3d243520",
        "type": "function",
        "z": "a124555c43bf7bf0",
        "name": "function 22",
        "func": "return msg",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 810,
        "y": 1000,
        "wires": [
            [
                "2089aafc129801af"
            ]
        ]
    }
]

```

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [3 May 2023 17:08 UTC](https://discourse.nodered.org/t/character-dont-appear-in-template/78151/4 "2023-05-03T17:08:50Z")

</div>

In your template: use `{{{payload}}}`

Certain characters need to be escaped.

 ![Screenshot 2023-05-03 at 18.06.59](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/17ae1cc34cb081bc840994533ec713ec26972b35.png)

---

<div class="post-metadata">

**Author:** ![Gabriel2](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Gabriel2](https://discourse.nodered.org/u/Gabriel2)\
**Post date:** [3 May 2023 17:11 UTC](https://discourse.nodered.org/t/character-dont-appear-in-template/78151/5 "2023-05-03T17:11:51Z")

</div>

I can't believe that was it, thank you very much.

---

<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:** [17 May 2023 17:12 UTC](https://discourse.nodered.org/t/character-dont-appear-in-template/78151/6 "2023-05-17T17:12:28Z")

</div>

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