Escape characters within JSON object not working, even when converted to a string
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2020 03:13 PM
Hello,
Using Flow Designer, I'm trying to update the work notes field of an Alert with the response body from a REST step. This is fine, but the resulting work note ignores escape characters, specifically "\n".
Is there a reason this could be happening, and is there a workaround to get escape characters to work?
I have tried manually converting the JSON object to a string using .stringify(), but the same issue remains. I've tried escaping the escape with "\\n". The same issue is occurring when updating an Alert manually through a glide record object.
Thank you.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2020 11:40 PM
Hello,
I think the below link will help you...
https://hi.service-now.com/kb_view.do?sysparm_article=KB0721958
Mark my ANSWER as CORRECT and HELPFUL if it works

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2020 02:29 AM
Hi ,
In case of json suppose ,
"FirstName": "\nTanmay",
o/p will be,
FirstName:\nTanmay
so when you stringify(); ' \nTanmay ' will be your value for FirstName,Please check for this and update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2020 08:42 AM
Hi Priya,
Correct, once stringified the "\n" is visible in the output as part of the string.
For your example, the output that we get is:
"\nTanmay"
The output we would want is:
"
Tanmay"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2020 02:33 AM
Hi,
What about <br/>?
Thanks,
Ashutosh