# Jsonata in combination with the buffer maker of node-red-contrib-buffer-parser

**URL:** <https://discourse.nodered.org/t/jsonata-in-combination-with-the-buffer-maker-of-node-red-contrib-buffer-parser/100576>\
**Category:** General\
**Tags:** buffer-parser\
**Created:** [16 March 2026 10:54 UTC](https://discourse.nodered.org/t/jsonata-in-combination-with-the-buffer-maker-of-node-red-contrib-buffer-parser/100576 "2026-03-16T10:54:58Z")\
**Posts on this page:** 5\
**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:** [16 March 2026 10:54 UTC](https://discourse.nodered.org/t/jsonata-in-combination-with-the-buffer-maker-of-node-red-contrib-buffer-parser/100576/1 "2026-03-16T10:54:58Z")

</div>

Hi There,

This might be a question for @Steve-Mcl but perhaps someone else has an idea.

I'm using the buffer maker to create a buffer array from a string value, the format is basically: `<length of string><string in utf8>`, e.g., the string "7.0" becomes [3,55,46,48].

What I'm doing using using JSONata to compute the string length and then create a buffer for the string. But when I use JSONata to obtain the length, i.e., `$length($$.version)` I get zero, i.e. [3,55,46,48] even though the value is 3:

 ![Screenshot 2026-03-16 at 11.41.12](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/b/4be08a960d914617d8ca374bd5074d468c295072.png)

instead using a number value and the fixed value of 3, I get the required 3 in the buffer array:

 ![Screenshot 2026-03-16 at 11.39.21](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/6/1677172a1bf76e6066fa107d177e0d55de2391a5.png)

The flow using JSONata is attached, replacing the JSONata (in the buffer maker node) with Number field is all I did, i.e, the type and length remains the same. The inject node just defines the version value on the msg object.

Bug? Or Feature? I don't quite understand what's going on .... I can't imagine being the first to be doing this so something is going amiss here ☹

Cheers!

```flows
[{"id":"54336c7ccef2bba3","type":"buffer-maker","z":"69d58ec6f237a63f","name":"","specification":"spec","specificationType":"ui","items":[{"name":"item1","type":"uint8","length":1,"dataType":"jsonata","data":"$length($$.version)"},{"name":"item2","type":"utf8","length":-1,"dataType":"msg","data":"version"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":342,"y":787,"wires":[["645f2adc666de2e4"]]},{"id":"5e7a894f80e77d0a","type":"inject","z":"69d58ec6f237a63f","name":"","props":[{"p":"version","v":"7.0","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":319,"y":984,"wires":[["54336c7ccef2bba3"]]},{"id":"645f2adc666de2e4","type":"debug","z":"69d58ec6f237a63f","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":355,"y":581,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 March 2026 14:57 UTC](https://discourse.nodered.org/t/jsonata-in-combination-with-the-buffer-maker-of-node-red-contrib-buffer-parser/100576/2 "2026-03-16T14:57:28Z")

</div>

Hi @gregorius I don't have time right now to fully digest what you've written. What I will say is if it's the buffer maker then it's quite possibly a bug. That was added much later and doesn't get used anywhere near as much as the buffer Parser.

Just letting you know I'm not ignoring this. Feel free to give me a nudge if I don't get around to answering today or tomorrow.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 March 2026 15:51 UTC](https://discourse.nodered.org/t/jsonata-in-combination-with-the-buffer-maker-of-node-red-contrib-buffer-parser/100576/3 "2026-03-16T15:51:32Z")

</div>

> [@gregorius](#):
>
> Bug? Or Feature? I don't quite understand what's going on .... I can't imagine being the first to be doing this so something is going amiss here ☹

So it is likely you are either the first to hit this (or the first to report it 😉 ).  
I imported your flow and it looks like a bug to me.

I have a feeling this is related to JSONata changes in NR 4 (sync -\> async) that I have not had unit tests for. Bah!

If you would be kind enough to raise an issue it will get fixed.

In the meantime, as I am certain you know you can pass the result for the JSONata into the parser as a msg prop.

---

<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:** [16 March 2026 16:10 UTC](https://discourse.nodered.org/t/jsonata-in-combination-with-the-buffer-maker-of-node-red-contrib-buffer-parser/100576/4 "2026-03-16T16:10:45Z")

</div>

Hi @Steve-Mcl

> [@Steve-Mcl](#):
>
> In the meantime, as I am certain you know you can pass the result for the JSONata into the parser as a msg prop.

Yep, that would be the work around - which I will use in due course. Moved on to another problem, will come back to it.

> [@Steve-Mcl](#):
>
> If you would be kind enough to raise an issue it will get fixed.

Yep I can do that.

I did have a quick look at the code, but didn't see it so hence I wasn't sure.

EDIT: [Pull request](https://github.com/Steve-Mcl/node-red-contrib-buffer-parser/issues/30) is up. The fix is as you said, async v. sync related. It would probably works mostly because normally evaluateProperty doesn't have to do 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:** [14 June 2026 16:11 UTC](https://discourse.nodered.org/t/jsonata-in-combination-with-the-buffer-maker-of-node-red-contrib-buffer-parser/100576/5 "2026-06-14T16:11:36Z")

</div>

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