Replace NewLine Text with \n

Hi,

I have a program running on my server which accepts a message to be sent over messenger. I am calling its API to send message via the HTTP Request node.

Here I have a multi-line string that I want to put in the JSON. How do I replace the message body string’s new line with \n. I think might have to use the function node.

Thanks

You can do something like this:

..., "messageBody": JSON.stringify($node["SET"].json["???"]), ...
1 Like