Multi-line text variable to notification with brakes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2019 01:06 PM
Hey, I am trying to pull multi-line text variables from request to the notification. It works fine, but the new line breaks from a variable are not included in the notification. Any idea how to solve this?
My email script:
var id;
if(current.sys_class_name == 'sc_req_item'){
id=current.sys_id;
}else{
id = current.sysapproval.sys_id;
}
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(id);
set.load();
var vs = set.getFlatQuestions();
var table = '<table style="width:75%" border="1">';
for (var i=0; i < vs.size(); i++) {
if(vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '' ) {
table += '<tr><th>'+vs.get(i).getLabel()+'</th><th>'+vs.get(i).getDisplayValue()+'</th></tr>';
}
}
template.print(table+'</table>');
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2019 11:38 PM
Hi,
Can you try to print in background script what value it shows?
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
12-16-2019 08:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2019 07:07 PM
Hi,
Can you try to query the ritm table and get the value in the email script?
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
04-05-2024 09:39 AM - edited 04-05-2024 12:36 PM