- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Hi Team,
I am working on a Flow Designer (Application Access Request Flow) where a notification is triggered after fulfillment of a Requested Item (RITM).
The notification is triggering successfully, but I am facing two issues in the email content.
I am trying to include a clickable link in the notification that redirects to the specific RITM.
Current Behavior:
- The email is sent successfully
- However, the link appears with an incorrect or empty sys_id (sometimes null)
- As a result, it does not open the expected RITM record
Requirement:
- The link should dynamically open the correct RITM record every time
- Expected format:
What I Tried:
Issue:
- fd_data.trigger.table_name and fd_data.trigger.current.sys_id are not resolving correctly in Flow Designer context
I am using a catalog variable:
- Name: list_of_members
- Type: List Collector (reference → sys_user)
Current Behavior:
- Notification does not display selected users
- Since it stores sys_ids, nothing meaningful is shown
Requirement:
- Display user names in notification
Expected Output:
Note:
For link I have used the SetFlowVariables.
In Flow for Notification I have used the Send Email & That flow variable I have called in notification for link.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Hello @Sirri ,
can you share me the screenshot of the flow?
Also, try adding a log action to check what values are coming through:
gs.log("Table Name: " + fd_data.trigger.table_name);
gs.log("Sys ID: " + fd_data.trigger.current.sys_id);
For the list collector, once we see the flow setup, we can adjust the script to resolve sys_ids into user names before sending them in the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Hello @Sirri ,
can you share me the screenshot of the flow?
Also, try adding a log action to check what values are coming through:
gs.log("Table Name: " + fd_data.trigger.table_name);
gs.log("Sys ID: " + fd_data.trigger.current.sys_id);
For the list collector, once we see the flow setup, we can adjust the script to resolve sys_ids into user names before sending them in the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Try this in your toggle script :
var url = '<a href="' + '/' + fd_data.trigger.table_name + '.do?sys_id=' + fd_data.trigger.request_item.sys_id + '">' + fd_data.trigger.request_item.number + '</a>';
return '[code]' + url + '[/code]';
In your script fd_data.trigger.sys_id might be fetching different sys_id !
I tried this in work notes and its working :
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi @Sirri
Since List Collector variables store an array of comma-separated sys_ids, using Email Script, you can extract and display them by building a helper loop .
- Create a Notification Email Script
Go to System Notification > Email > Notification Email Scripts and click New.
Name: display_list_collector_users
(function runMailScript(current, template, email, email_action, event) {
var members = current.variables.list_of_members;
if (members) {
var userNames = [];
var userGr = new GlideRecord('sys_user');
userGr.addQuery('sys_id', 'IN', members);
userGr.query();
while (userGr.next()) {
userNames.push(userGr.getDisplayValue());
}
if (userNames.length > 0) {
template.print('Users granted access: ' + userNames.join(', '));
} else {
template.print('Users granted access: None');
}
} else {
template.print('Users granted access: None');
}
})(current, template, email, email_action, event);
- Add Script to Notification
Go to Notification record> Advanced view > add
${mail_script:display_list_collector_users} in the Message body
where you want the names to appear.
This approach ensures your list dynamically prints out nicely as: Users granted access: User1, User2, User3.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti