Line breaks nor sending through Rest

Jack62
Giga Guru

Evening all,

 

We are trying to send through multi line descripts and work notes through a rest integration but it is not landing with the breaks the other side. Script and screenshot below. Any help as always, most appreciated.

 

description = current.description.replace(/(\r\n|\n|\r)/gm, \\r\\n);

  description = description.replaceAll('\\','\\\\');

  description = description.replace(/"/g, '\\"');

 

Jack62_0-1712265886340.png

 

We also get the same format when sending multi lines in the work notes fields too.

 

Jack

 

1 ACCEPTED SOLUTION

Jack62
Giga Guru

We also just tried sending as \\n and they get the following 

 

Jack62_0-1712306194107.png

 

View solution in original post

3 REPLIES 3

Sohail Khilji
Kilo Patron
Kilo Patron

Try this 

description = current.description.replace(/(\r\n|\n|\r)/gm,"").replace(/ {1,}/g," ");

☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Jack62
Giga Guru

Hey

 

I have tried the above and they get the notes through all in one line with no space!

 

JAck

Jack62
Giga Guru

We also just tried sending as \\n and they get the following 

 

Jack62_0-1712306194107.png