Parsing data in table fields

Jeremyramirez12
Tera Contributor

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?

2 REPLIES 2

Sanjay191
Tera Sage

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.




Ankur Bawiskar
Tera Patron
Tera Patron

@Jeremyramirez12 

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.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader