JSON respose for multi-line string

balaram
Mega Contributor

How can we write multi-line string into JSON response ? Right now , it's appending all lines and showing as single line to the Requester. We want to display as it is like on Service now form.

Thanks

Balaram

3 REPLIES 3

Chinthuja2
Giga Contributor

You can split the response and add it to your field, Can you post your script here


Thank you for you replay !



In this case, we are sending response from ServiceNow. Below is the actual field in service now.


find_real_file.png


3rd system is getting response like below.


"Description" : "-Implement change request 1 -Implement change request 2 -Implement change request 3 -Implement change request 4"



They are asking to send the response in the same format how it displays in ServiceNow(in sepeated lines).


Have you tried using line breaks ('\n') in between those lines??


So in JSON you may need to add "\\n" so that Python will not escape this as backslash.