- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 07:57 AM
I had to create a new Description (HTML) field, so the Service Desk agents can use the field with style formatting (bold italics...). However, for reporting purposes across the company we use the ootb Description (String type) field.
I would like to grab the content from the HTML Description to the ootb String type Description field. I understand the styling won't transfer, but I want the full content to be copied over, including the line breaks as it is.
My role doesn't really involve SNOW development, so I am not really sure what to do here, and if possible I like this to be done without using Client-script. Your help is much appreciated!
I understand the solution might require some coding, but please keep in mind I cannot code, but I can make sense of what is written in a code. Again, thank you in advance!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 10:09 AM
This solution contains one Business Rule
When I update the incident's HTML description field, the current contents is copied and populated into the incidents description field.
Take a look at the images and see if it fits your requirements. Let me know if you need any changes.
Business rule configuration:
Advanced Tab:
Script:
(function executeRule(current, previous /*null when async*/) {
current.description = current.u_html_description; //replace 'u_html_description with your field name for html description'
})(current, previous);
Result: (Incidents html field is updated and copied with styling to the Description field)
It's possible to use a FLOW to do this instead, but I think a business rule is the way to go here and it's very light on the code.
Please mark my answer as Correct/Helpful based on impact
Regards,
Dan H

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 08:30 AM
Hi Sam,
On what records do you want to do this and when do you want this copy to happen?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 09:32 AM
This would be for incident records, and preferably anytime the HTML description field is updated, the latest content needs to sync with the string type description field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 10:09 AM
This solution contains one Business Rule
When I update the incident's HTML description field, the current contents is copied and populated into the incidents description field.
Take a look at the images and see if it fits your requirements. Let me know if you need any changes.
Business rule configuration:
Advanced Tab:
Script:
(function executeRule(current, previous /*null when async*/) {
current.description = current.u_html_description; //replace 'u_html_description with your field name for html description'
})(current, previous);
Result: (Incidents html field is updated and copied with styling to the Description field)
It's possible to use a FLOW to do this instead, but I think a business rule is the way to go here and it's very light on the code.
Please mark my answer as Correct/Helpful based on impact
Regards,
Dan H
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 11:32 AM
Thank you so much Dan, this is really helpful! One question, is there a way to remove the HTML codes from copying over to the string type description field? Just the content between the (<p>) code, in general no html code should be copied to the String field.
Most of the users who run the reports are non-dev users and they are likely to find any code like content to be "distracting."