how can i change the output to #hex
Hi @ItsLarsBB
You could use a Function node configured with:
msg.payload = "#"+msg.payload;
return msg;
The Function allows you to write JavaScript that is run against each message it receives.
https://nodered.org/docs/writing-functions
If you’re going to spend much time with Node-RED, it’s worth familiarising yourself with some of the basics of JavaScript
Other options include…
You could use a Template node (normal template, not dashboard template) configured with:
#{{payload}}
You could use a Change node to set msg.payload to the expression '#' & $.payload
Hi @knolleary
Thx
The change
node can also use a regex to modify the string -- like so:
(the regex character ^
matches the beginning of the line)