# Message Payload Limitations

**URL:** <https://discourse.nodered.org/t/message-payload-limitations/59711>\
**Category:** General\
**Created:** [11 March 2022 13:06 UTC](https://discourse.nodered.org/t/message-payload-limitations/59711 "2022-03-11T13:06:44Z")\
**Posts on this page:** 5\
**Page:** 2

<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:** [14 March 2022 15:19 UTC](https://discourse.nodered.org/t/message-payload-limitations/59711/21 "2022-03-14T15:19:34Z")

</div>

In a change node try JSONata using $substring().

Like this:

```auto
[
    {
        "id": "65f4413785b287b6",
        "type": "change",
        "z": "2f55b30644be1197",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$substring(payload, start, length)",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 340,
        "y": 240,
        "wires": [
            []
        ]
    }
]

```

The "Length" parameter is optional!

---

<div class="post-metadata">

**Author:** ![StevenMurray2022](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stevenmurray2022/32/58300_2.png) [@StevenMurray2022](https://discourse.nodered.org/u/StevenMurray2022)\
**Post date:** [14 March 2022 15:44 UTC](https://discourse.nodered.org/t/message-payload-limitations/59711/22 "2022-03-14T15:44:55Z")

</div>

Hi Garry,

Do I just put the start and length values to say 7 and 160 to miss out the first 6 characters?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/bef9ac1268c2f0bf6dbb2fdb578996deb343acf5.png)

---

<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:** [14 March 2022 15:48 UTC](https://discourse.nodered.org/t/message-payload-limitations/59711/23 "2022-03-14T15:48:54Z")

</div>

Start would be 6! first element is 0. omit the length, you'll get the rest of the string

```auto
$substring(payload,6)

```

Should do it!

---

<div class="post-metadata">

**Author:** ![StevenMurray2022](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stevenmurray2022/32/58300_2.png) [@StevenMurray2022](https://discourse.nodered.org/u/StevenMurray2022)\
**Post date:** [15 March 2022 11:43 UTC](https://discourse.nodered.org/t/message-payload-limitations/59711/24 "2022-03-15T11:43:09Z")

</div>

> [@ghayne](#):
>
> ```auto
> [
> {
> "id": "2f55b30644be1197",
> "type": "tab",
> "label": "Flow 2",
> "disabled": false,
> "info": "",
> "env": []
> },
> {
> "id": "10b71daa4f1b1bb0",
> "type": "inject",
> "z": "2f55b30644be1197",
> "name": "",
> "props": [
> {
> "p": "payload"
> }
> ],
> "repeat": "",
> "crontab": "",
> "once": false,
> "onceDelay": 0.1,
> "topic": "",
> "payload": "Message1",
> "payloadType": "str",
> "x": 100,
> "y": 100,
> "wires": [
> [
> "9e773d118fa24bdc"
> ]
> ]
> },
> {
> "id": "9e773d118fa24bdc",
> "type": "join",
> "z": "2f55b30644be1197",
> "name": "",
> "mode": "custom",
> "build": "string",
> "property": "payload",
> "propertyType": "msg",
> "key": "topic",
> "joiner": "",
> "joinerType": "str",
> "accumulate": false,
> "timeout": "",
> "count": "2",
> "reduceRight": false,
> "reduceExp": "",
> "reduceInit": "",
> "reduceInitType": "",
> "reduceFixup": "",
> "x": 330,
> "y": 100,
> "wires": [
> [
> "521b3db1a5d220e2"
> ]
> ]
> },
> {
> "id": "fbe2a05264d45f1f",
> "type": "inject",
> "z": "2f55b30644be1197",
> "name": "",
> "props": [
> {
> "p": "payload"
> }
> ],
> "repeat": "",
> "crontab": "",
> "once": false,
> "onceDelay": 0.1,
> "topic": "",
> "payload": "Message2",
> "payloadType": "str",
> "x": 100,
> "y": 140,
> "wires": [
> [
> "9e773d118fa24bdc"
> ]
> ]
> },
> {
> "id": "521b3db1a5d220e2",
> "type": "debug",
> "z": "2f55b30644be1197",
> "name": "",
> "active": true,
> "tosidebar": true,
> "console": false,
> "tostatus": false,
> "complete": "false",
> "statusVal": "",
> "statusType": "auto",
> "x": 610,
> "y": 100,
> "wires": []
> }
> ]
> 
> ```

That's it. Thanks Garry. 🙂

---

<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:** [29 March 2022 11:44 UTC](https://discourse.nodered.org/t/message-payload-limitations/59711/25 "2022-03-29T11:44:08Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/message-payload-limitations/59711.md?page=1)
