# $split doesn't support default settings?

**URL:** <https://discourse.nodered.org/t/split-doesnt-support-default-settings/101002>\
**Category:** Core Development\
**Tags:** jsonata\
**Created:** [13 May 2026 08:13 UTC](https://discourse.nodered.org/t/split-doesnt-support-default-settings/101002 "2026-05-13T08:13:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [13 May 2026 08:13 UTC](https://discourse.nodered.org/t/split-doesnt-support-default-settings/101002/1 "2026-05-13T08:13:20Z")

</div>

Hi There,

This might be a known unknown since I'm using NR 4.0.9 - so it might be fixed already.

Or maybe it's not a bug? In which case what am I doing wrong!

It concerns JSONata $split:

 ![Screenshot 2026-05-13 at 10.00.22](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2d4393c3abcded14281ee0b113092cc108cc907.png)

The description gives me to understand that `$split("fubar")` is a valid expression and should give me the same as `$split("fubar", "")`, i.e. `["f","u",...]`

```flows
[{"id":"4fa3f5ebb2b075ee","type":"inject","z":"427d65940cf71aac","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$split(\"fubar\")","payloadType":"jsonata","x":3289,"y":624,"wires":[["034f65b11c1f431e"]]},{"id":"034f65b11c1f431e","type":"debug","z":"427d65940cf71aac","name":"debug 27","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":3366,"y":512,"wires":[]}]

```

but it doesn't instead, I see this in the debug panel:

![Screenshot 2026-05-13 at 10.08.25](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/e/de19c8074027359ed5f027a0d051e402eb759fa2.png)

Adding the separator value, i.e. `$split("fubar", "")`, works:

 ![Screenshot 2026-05-13 at 10.09.30](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/6/e64e394a415d07b7024d2da11b4da85ead444ec6.png)

I know this is niche since JSONata is niche but hey!

Cheers!

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [13 May 2026 13:02 UTC](https://discourse.nodered.org/t/split-doesnt-support-default-settings/101002/2 "2026-05-13T13:02:53Z")

</div>

Doesn't work in 5.0.0-beta.6 either, so probably either a bug or mis-information in the description.  
In the JSONata description it says

> The separator parameter can either be a string or a regular expression (regex). If it is a string, it specifies the characters within str about which it should be split. If it is the empty string, str will be split into an array of single characters. If it is a regex, it splits the string around any sequence of characters that match the regex.

which implies that the separator must exist - even if an empty string. So the chances are that the description of the function is in error

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [13 May 2026 14:57 UTC](https://discourse.nodered.org/t/split-doesnt-support-default-settings/101002/3 "2026-05-13T14:57:24Z")

</div>

> [@Buckskin](#):
>
> description of the function is in error

I would also _split_ the difference and update the documentation - obviously it isn't something that is used often and if so, then correctly. The error message isn't something that is overseen if it occurs.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [13 May 2026 16:00 UTC](https://discourse.nodered.org/t/split-doesnt-support-default-settings/101002/4 "2026-05-13T16:00:06Z")

</div>

> [@gregorius](#):
>
> I would also _split_ the difference and update the documentation

Well done & thank you 😁

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [13 May 2026 16:10 UTC](https://discourse.nodered.org/t/split-doesnt-support-default-settings/101002/5 "2026-05-13T16:10:21Z")

</div>

> [@Buckskin](#):
>
> Well done

Happy cake day btw 😉

---

<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:** [12 July 2026 16:10 UTC](https://discourse.nodered.org/t/split-doesnt-support-default-settings/101002/6 "2026-07-12T16:10:22Z")

</div>

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