JSON parse error with string has new line characters

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2021 08:04 AM
Noticed some times I received JSON parse error when the string contains new line characters.
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2021 12:39 AM
Hey @deepak.shaw,
You should escape the controll characters like new line. Try .replaceAll(‘\n’,‘\n’) on the JSON string, and than parse it.
Regards,
Bojan

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2021 04:17 AM
Hi,
Thanks for the reply… but suddenly it starts working, without doing any changes, it parses correctly with replacing any character.
