Client Script not showing variable message on new line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 04:34 AM
In a client script, I’m trying to display a message on a variable field with line breaks (using <br> or \n). But the message appears in a single line. Is there a ServiceNow-supported way to render messages with new lines or styled HTML in catalog items?
Instead on writing 3 new g_form.showMessage('cc', 'My message');
is there any way to insert a new line in long description?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 08:25 PM - edited 07-07-2025 08:27 PM
Hi @Prudhvi Potru
As Ankur mentioned, g_form.showFieldMsg() does not support HTML tags. As an alternative, consider using a 'Rich Text Label'.
Sample:
Regards,
Siva