Well - the gremlins are really mucking me up today
Tried using Blocky node to convert payload to lowercase - get error
Tried using a contrib node - got error
Tried using JSONata - got error
Will someone please just give me some working code!!!! #LOL
Well - the gremlins are really mucking me up today
Tried using Blocky node to convert payload to lowercase - get error
Tried using a contrib node - got error
Tried using JSONata - got error
Will someone please just give me some working code!!!! #LOL
An example flow with the text would be helpful, but the JSONata would be
$lowercase($$.payload)
and Javascript
msg.payload = msg.payload.toLowerCase()
return msg;
I use a String Node to do that.

What is that string node?
Are you saying you are still getting errors, if so export an example flow please.
Sorry, I thought it was included in the standard Node Red installation. I was wrong.
You can find it here: node-red-contrib-string (node) - Node-RED
It does all sorts of text manipulation. For example, I use it to manipulate the HTML file of another node.
After getting the HTML text of the node, the String Node performs a Find & Replace for the hex string of the background color of the node. The flow then re-saves the node's HTML file. This changes the background color for the node from what the developer has setup.
It probably has 30+ different ways to manipulate a text string
How is "red" generated?
Standdown everyone ![]()
So I had a switch node (this is a flow that has been working for a long time) but needed to now make it's input into lowercase
What I hadn't realised was that it was working on msg.payload.status not msg.payload so that is why everything was failing on me when trying to convert an object to lowercase
And unfortunately, the error messages didn't provide a clue to this ![]()

I use Node Red so I don't have to learn JSONata or Javascript. ![]()
I needed a quick solution so I was up for anything that would have worked!
That contib node is the node for the job ![]()
The cognitive bias to remain ignorant to other code and ways is not an enlightened approach.
You could simply use a simple JSONata expression in the switch node property. Not that difficult to learn or understand. and makes the flow shorter and adds no more complexity in my opinion.
I think the key phrase is "in my opinion" ![]()
It is very good for getting around missing core features but unless people use it a lot, it's syntax can easily trip people up
Your the forums leading JSONata expert so it is easy for you ![]()
Some people (like myself) are always looking for no-text-code solutions wherever possible ![]()
I do you use one JSONata expression a lot as the no-code workaround, for the missing "not contains" in the switch node, just causes messy wiring

But I always have to find an existing one and cut and paste it as I forget the syntax of it ![]()
I'm not going to argue with 1,2 and 3 as we'd be here all day ![]()
But 3 IS true
You ARE the forums leading JSONata expert ![]()
For which we are all grateful for ![]()
There are others not so vocal that would out shine me, I am the most prolific.
Enjoy the rest of the your weekend, as as you say we could discuss points to Ad Nauseam
Not to start a philosophical argument but I am going to have a different opinion here. Node Red was created as a graphical tool. Therefore, if the Node Red folks or community developer has created a node that will do the job that would otherwise require JSONata or Javascript, why not use it? To take it to the extreme, I don't need to know the language that Microsoft Word was written to compose a letter.
This is my opinion. ![]()
You can choose to do things anyway you wish, i am not arguing that.
I simple state that to choose to not look at other ways in not an enlightened approach.
![]()
I'm glad I'm not the only one who does this! I may, however, hold the record for how often! We'll never know because I have nothing more to say on the subject.
![]()