- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 11:24 AM
I am triggering notification through event where I am passing array as PARAM but they were coming as one after one in notification but expectation is one in one line. I tried with below code but not working?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 09:41 AM - edited 08-26-2024 09:43 AM
Pass it as a comma spirited array when you call the event. Then use a mail script to print them in the email line by line. In your notification it to call a mail script your do ${mail_script:scriptname}
Your mail script should look something like this. This is based off your current code already having the display value rather then the sys_id.
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var Persona = event.parm1.toString().splite(",");
for (var i = 0; i < Persona.length; i++) {
template.print(Persona[i] + "</br>"); //use /br instead of \n becasue it is a new line in HTML in a notification
}
})(current, template, email, email_action, event);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 11:57 AM
Is it that you are trying to print a list of persona's in a notification but instead of a comma separated list you want to show the 1 persona per line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2024 05:47 AM
Exactly @Brian Lancaster that's what I am trying for.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 09:41 AM - edited 08-26-2024 09:43 AM
Pass it as a comma spirited array when you call the event. Then use a mail script to print them in the email line by line. In your notification it to call a mail script your do ${mail_script:scriptname}
Your mail script should look something like this. This is based off your current code already having the display value rather then the sys_id.
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var Persona = event.parm1.toString().splite(",");
for (var i = 0; i < Persona.length; i++) {
template.print(Persona[i] + "</br>"); //use /br instead of \n becasue it is a new line in HTML in a notification
}
})(current, template, email, email_action, event);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2024 12:01 PM
@KM SN Ideally, you should handle this inside the email script and not via the script from where the event is triggered.