How to remove the special characters" " that are added to the comment when the user raises a Incident on portal through get help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 05:43 AM
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(" ", " ");
notes += producer.more_details.getQuestion().getLabel() + ':' + '\n' + details + '\n';
Thanks in advanced.
- Labels:
-
Incident Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 05:50 AM
Can you replace
details = details.replace(" ", " ");
with
details = details.replace("\ ", " ");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 06:54 AM
Hey, This didn't worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 07:04 AM
Hi,
when you try to print that in log what value came?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 11:20 PM
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