Message Payload Limitations

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

Like this:

[
    {
        "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!

Hi Garry,

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

image

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

$substring(payload,6)

Should do it!

1 Like

That's it. Thanks Garry. :slight_smile:

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