<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: HTML Tags Description field in HRSD forum</title>
    <link>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3258502#M41323</link>
    <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/686879"&gt;@VasukiS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to preserve only the plain text in description, you should strip the HTML tags when copying from rich_description.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use BR....&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function stripHTML(html) {
    var tmp = new GlideElement();
    tmp.setDisplayValue(html);
    return tmp.getDisplayValue().replace(/&amp;lt;[^&amp;gt;]*&amp;gt;/g, '');
}

// In Business Rule:
current.description = stripHTML(current.rich_description);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; or Flow (script step)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var plainText = current.rich_description.replace(/&amp;lt;[^&amp;gt;]*&amp;gt;/g, '');
current.description = plainText;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 May 2025 17:12:50 GMT</pubDate>
    <dc:creator>folusho</dc:creator>
    <dc:date>2025-05-08T17:12:50Z</dc:date>
    <item>
      <title>HTML Tags Description field</title>
      <link>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3258434#M41321</link>
      <description>&lt;P&gt;HI Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the HR Module, we are using the rich_description field. Any text entered into the rich_description field. It is also copied into the description field as per the out-of-the-box behavior.&lt;/P&gt;&lt;P&gt;However, while copying the data, it includes HTML tags.&lt;/P&gt;&lt;P&gt;Is this out-of-the-box behavior if we choose to use the rich_description field?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 15:21:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3258434#M41321</guid>
      <dc:creator>VasukiS</dc:creator>
      <dc:date>2025-05-08T15:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags Description field</title>
      <link>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3258439#M41322</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/686879"&gt;@VasukiS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The inclusion of HTML tags when copying data from the rich_description field to the description field is indeed the out-of-the-box behavior in ServiceNow. This happens because the rich_description field uses a rich text editor, which stores content as HTML to preserve formatting (like bold, italics, lists, links, etc.).&lt;/P&gt;&lt;P&gt;If the requirement is to strip the HTML tags before copying the content to the description field, you can use the gs.stripHTML() function in a business rule or a script include to handle this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my response was helpful, please mark it as the correct answer and close the thread. This will help others who come across the same issue.&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;Gaurav Rathaur&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 15:26:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3258439#M41322</guid>
      <dc:creator>Gaurav Rathaur</dc:creator>
      <dc:date>2025-05-08T15:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags Description field</title>
      <link>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3258502#M41323</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/686879"&gt;@VasukiS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to preserve only the plain text in description, you should strip the HTML tags when copying from rich_description.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use BR....&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function stripHTML(html) {
    var tmp = new GlideElement();
    tmp.setDisplayValue(html);
    return tmp.getDisplayValue().replace(/&amp;lt;[^&amp;gt;]*&amp;gt;/g, '');
}

// In Business Rule:
current.description = stripHTML(current.rich_description);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; or Flow (script step)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var plainText = current.rich_description.replace(/&amp;lt;[^&amp;gt;]*&amp;gt;/g, '');
current.description = plainText;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 17:12:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3258502#M41323</guid>
      <dc:creator>folusho</dc:creator>
      <dc:date>2025-05-08T17:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: HTML Tags Description field</title>
      <link>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3263443#M41390</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/686879"&gt;@VasukiS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for marking my solution as helpful.&lt;/P&gt;&lt;P&gt;Please can you mark as solution given so as to help others in the community.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 13:38:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/hrsd-forum/html-tags-description-field/m-p/3263443#M41390</guid>
      <dc:creator>folusho</dc:creator>
      <dc:date>2025-05-14T13:38:10Z</dc:date>
    </item>
  </channel>
</rss>

