How to remove the special characters" " that are added to the comment when the user raises a Incident on portal through get help?

Ananya Gupta1
Kilo Explorer

When user creating an incident through get help ,if "double space" is provided at the end of the sentence in the field "Please provide more details so we can quickly solve your problem" .The special characters" " are added to that comment in the backend.

Can anyone tell how to fix this in record producer script-

var details = producer.more_details.getDisplayValue();
details = details.replace(/<\/?[^>]+(>|$)/g, "");
details = details.replace("&nbsp;", " ");
notes += producer.more_details.getQuestion().getLabel() + ':' + '\n' + details + '\n';

 

Thanks in advanced.

5 REPLIES 5

Jaspal Singh
Mega Patron
Mega Patron

Can you replace

details = details.replace("&nbsp;", " ");

with

details = details.replace("\&nbsp;", " ");

Hey, This didn't worked

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

when you try to print that in log what value came?

Regards
Ankur

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

Hi Ankur,

The system logs is not showing up the logs for this when I am trying to print the error and info messages. didn't got the exact reason for this but it i tried several times it is not showing up any logs.

Regards,

Ananya Gupta