Content in Description of Known Error is not maintaining its format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2025 08:27 PM
Dear Community member,
I have observed, while creating a known error and filling description part with paragraphs and bullet points, but when I save the data and view it in article format, the formatting changes to one paragraph. Can you please guide what can be done to avoid this issue?
In article format:
Article view:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
@BibhuRanjaM Any luck on finding a solutuion?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
This issue occurs because the “Description” field in the Known Error record is a plain text field, while the Knowledge Article view expects or renders HTML or rich text. When you save multiline or formatted text (like bullet points or line breaks) into a plain text field, ServiceNow strips or normalizes it into a single paragraph.
Here’s how to fix or work around it depending on your configuration:
1. Confirm Field Type
Go to System Definition → Tables, open your Known Error table (e.g., problem_known_error or custom extension).
Check the dictionary entry for the Description field.
If the Type is String (255) or String (4000) → it only supports plain text.
You need to change it to HTML (html) to preserve formatting and bullet points.
2. Change the Field to Rich Text (if allowed)
In the dictionary entry for description:
Change Type → HTML
Add a Dictionary Attribute: html=true
Save and reload the form. The field will now display a rich text editor (RTE).
You can format text (bold, bullets, paragraphs) and it will persist in the Knowledge view.
⚠️ Caution: Changing a field type affects data model and existing integrations. If you can’t modify the OOB field, create a new custom field instead (e.g., u_detailed_description).
3. Alternative: Use a Rich Text Editor Variable
If the Description must remain plain text:
Add a UI Policy or UI Macro that uses an RTE variable to capture formatted content.
Store that content in a separate HTML field (e.g., u_description_html) and render that in the article template.
4. Adjust Knowledge Article Template
If the Known Error is published as a Knowledge article:
Go to Knowledge → Article Templates and open the template used for Known Errors.
Modify the field reference to use the HTML field:
${u_description_html}
instead of ${description}.
If you must keep using ${description}, wrap it with <pre> or <div style="white-space: pre-wrap;"> tags in the template:
<div style="white-space: pre-wrap;">${description}</div>
TL;DR
Your Description field is plain text, so formatting is stripped.
Solutions:
✅ Best: Change the field to HTML (rich text).
🧩 Or: Add <div style="white-space: pre-wrap;">${description}</div> to the Knowledge template.
💡 Optional: Store formatted content in a custom HTML field.
