- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2015 04:32 PM
Hi ServiceNow Community,
I am having some scripting issues attempting to copy the following:
I created a new field within the Change Management Module called "Change Description". The reason for this is that I wanted to have the change description field HTML but not impact the description field that sits across the task table.
What I would like to do is copy the text content from the Change Description field "u_change_description_html" into the standard "description" field.
I have attempted business rules and client scripts, but nothing I have tried seemed to help. I did see a few comments about this in other forums however, nothing seemed to work for me.
If anyone has any suggestions or has already created a script for this it would be greatly appreciated.
Regards,
Rob
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2015 12:03 AM
use regular expression to remove the html tags like below,
copy the below code and paste it in the business rules.
var text = current.u_change_description_html.toString();
var regX = /(<([^>]+)>)/ig;
var finalText = text.replace(regX, " ");
current.description = finalText;
try and lemme know if any issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2015 12:03 AM
use regular expression to remove the html tags like below,
copy the below code and paste it in the business rules.
var text = current.u_change_description_html.toString();
var regX = /(<([^>]+)>)/ig;
var finalText = text.replace(regX, " ");
current.description = finalText;
try and lemme know if any issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2015 02:33 PM
Hey Alex,
This seemed to work however the output file is as per the below. As you can see we still get " " other than that it worked like a treat
"& nbsp;"
# This is a Test Change #
"& nbsp;"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 11:58 PM
How to solve it?
Have you made any improvement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 11:57 PM
If there are symbols, tags will still be displayed.