how to write field message in new line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 01:52 AM
I want field message to appear like below in a single field message not like double messages.
I have tried \n, <br>,<BR> but no use. Please suggest.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 03:04 AM
Another way which would work in both native and portal
var message_text = 'line1' + '*' + 'line2' + '*' + 'examples :' + '*' + 'line3' + '*' + 'line4';
var arr = message_text.split('*');
for(var i=0; i<arr.length ; i++)
{
g_form.showFieldMsg('variable', arr[i], 'info');
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 03:05 AM
Another way which would work in both native and portal
OR try this
var message_text = 'line1' + '*' + 'line2' + '*' + 'examples :' + '*' + 'line3' + '*' + 'line4';
var arr = message_text.split('*');
var join = arr.join('\n');
g_form.showFieldMsg('variable', join, 'info');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 03:08 AM
Hi Ankur,
It is displaying message in separate lines, I want it in single message like above screenshot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 03:13 AM
Hi,
try this and share the screenshot
var message_text = 'line1' + '*' + 'line2' + '*' + 'examples :' + '*' + 'line3' + '*' + 'line4';
var arr = message_text.split('*');
var join = arr.join('\n');
g_form.showFieldMsg('variable', join, 'info');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 03:16 AM