List all approvers in an email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2025 04:21 AM
Hi Community,
I've designed a flow for approval reminders that automatically closes a request if no action is taken. However, I'm encountering a challenge with the email notification: I can only display one approver, whereas I’d like to include all individuals the approval request was sent to.
Is there a straightforward way to list all approvers in the notification email?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2025 04:38 AM
May you use a Notification Email Script
Add an Email Script (under System Notification > Email > Notification Email Scripts) and call it in your notification body. For example:
// Example: Get all approvers for the RITM
(function() {
var approvers = [];
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id); // current = RITM or Requested Item
gr.addQuery('state', 'requested'); // only pending approvers
gr.query();
while (gr.next()) {
approvers.push(gr.approver.getDisplayValue());
}
template.print(approvers.join(', '));
})();
Then, in your notification, you can insert:
${mail_script:AllApproversList}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2025 04:54 AM
Create a notification email script and use it in flow action.
Below is a sample,
(function runMailScript(current, template, email, email_action, event) {
var approversArray = [];
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sys_id);
gr.query();
while (gr.next()) {
approversArray.push(gr.approver.getDisplayValue());
}
if (approversArray.length > 0) {
template.print("Approvers: " + approversArray.join(", "));
} else {
template.print("No active approvers found.");
}
})(current, template, email, email_action, event);If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2025 05:15 AM
Below is a sample of doing the same function via Flow variables,
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2025 05:46 AM
Thanks for marking the post as helpful.
If this helped to answer your query, please accept the solution.
Thanks,
Bhuvan
