- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 05:27 AM
Hi All,
I have created an UI Action on Case form to create a Incident with all the information available on Case.
As "Service Offering" is not available on Case I have created a dialog box using UI Page and GlideModal asking for service offering.
But now everything is fine except the description is not getting copied with Line breaks. The Line breaks are getting disappeared in HTML in UI Page.
Requesting you to help me with this issue.
@Ankur Bawiskar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 06:53 AM
I was able to use solution from that link and used text area in HTML
UI Action:
UI Page:
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<g:evaluate var="jvar_sysid"
expression="RP.getWindowProperties().get('sysid')"/>
Description: <textarea id="description" rows="10" cols="30" name="description" value=""/>
</g:ui_form>
</j:jelly>
Client Script:
addLoadEvent(function(){
var m = GlideModal.prototype.get("showHTMLLineBreaks");
var p = m.getPreference("description");
document.getElementById("description").innerHTML = p; //create div with same id in HTML and set the innerHTML to the preference we grabbed from the Client Script
});
Output
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 05:35 AM - edited 06-25-2025 05:38 AM
you need to handle it separately if description field is HTML type
please share your UI action and UI page code
also check this
"Simple Modal Confirm" UI Page
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 05:39 AM - edited 06-25-2025 05:41 AM
@Ankur Bawiskar Sure Please find the below
UI Page HTML :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 05:40 AM
is description field HTML or string type?
share screenshots of what's coming in UI page and what do you expect?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 05:46 AM
@Ankur Bawiskar
This is in the description of Case
and this is the result in Incident form.
Expected : I want it to be the same way as it is in the case form