Parsing data in table fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2025 03:16 AM
We are getting issues when getting data from ServiceNow because of the "zero-width whitespace" characters. How do I parse data found in tables to remove this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2025 03:59 AM
Hello @Jeremyramirez12
please refer below logic to replace the zero-width whitespace characters
Here I'm taking an example like zero-width whitespace characters (like \u200B, \u200C, \u200D, \uFEFF, etc.)
So you can use the regular expression for this to remove the zero-width whitespace" characters
function removeZeroWidthChars(input) {
if (!input) return input;
return input.replace(/[\u200B-\u200D\uFEFF]/g, ' ');
}
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2025 04:18 AM
please share some more details along with screenshots and script.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader