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:
instead using a number value and the fixed value of 3, I get the required 3 in the buffer array:
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!
[{"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":[]}]

