We see a special character when we export a report in csv

Chindam Priyank
Tera Contributor

We had a BR glitch and we see records created with invisible special character in one the fields.

We would like to remove this invisible character and correct the value in field.

We need a background script to do this.

Kindly assist.

please refer the attachments

ChindamPriyank_0-1712588063574.png


When we search for a "BAPP0" see in query  "sysparm_query=numberSTARTSWITHBAPP%EF%BB%BF0"

 

I have tried the below script but no success.

example number is  = BAPP005865 . we are getting invisible character after BAPP?00....

 

var gr=new GlideRecord("table");
gr.addQuery('sys_id', '');
gr.query();
gr.setWorkflow(false);
gr.autoSysFields(false);
if(gr.next())
{
var ans=gr.getValue('number');
var F=ans.slice(0,4);
var E=ans.slice(5,11);
var res=F.concat(E);
gr.setValue('number',res);
gr.update();
gr.setWorkflow(false);
gr.autoSysFields(false);
}

1 REPLY 1

Community Alums
Not applicable

Hi @Chindam Priyank ,

You can use below:

string = string.replace(/[\/\\,+'"|:;=*?<>\]\[/]/g, '');