Is it expected behaviour for the input_text to not handle linefeeds? I am getting node-red errors when I try to put an address in that contains linefeeds.
This looks more like a syntax error on your part, I can see "
after the mustache }"
To expand json should end with a mustache }
. Also if the box in nodered is red, what you entered is not valid.
I feel like it is correct maybe another set of eye on what I am missing?
Where is the payload coming from? Connect a debug to that node, set it to complete message object
Copy the value from the debug, put it in code blocks, change the address but don’t change the structure.
use backticks
```
code here
```
I can see the enter ↵
symbol now, I haven’t seen that in NR. Typ new line is \n
. In the output node you should be able to use replace to change the ↵
to /n
.
Its coming off the icloud3 integration checking the geocode sensor. It returns it with a linefeed. I just confirmed input_text does not like linefeeds. I took the same text and sent it without and it went in fine. Looks like linefeeds are a no go for anyone who stumbles across this in the future. I will strip them out and figure out another way including maybe doing the \n like you suggested. Thank you for taking the time today to assist!
status = str.replace(/\n/g, '\\n');
msg.payload = status
return msg