
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 06:19 PM
I have a catalog item that asks for a list of users, I'm using a list collector that is accessing the sys_user table.
What I want to do later in my flow is the send a notification to all users added to the list collector field on the catalog item
The field is called:
u_shared_staff
I am sending the notification via a fire event action in a flow. I've added the "u_shared_staff" data pill, but it doesn't dot walk to the email field, therefore it is adding to parm2 the sys id's of the users, not their email addresses and it therefore obviously doesn't actually send them the email.
Ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 07:14 PM
let the data pill pick sys_ids and it should work with sysIds as well of the users
If those sysIds have email address then email will be sent in email logs provided you are sending it correctly in event parm1 or parm2
share your flow screenshot
You can use flow variable and store all the user sysIds and then use this flow variable to set the recipients
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 07:28 PM
Ultimately I went down the path of adding a flow variable and completed a flow logic step of "Set flow variables" and added a data script to store the email addresses as a string.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2025 01:46 PM
Hi Bidduam,
I'm trying to solve the exact same problem as you. I created a flow variable and added the logic step "Set flow variables"; however, I'm stuck on the code to loop through the users and get their email addresses.
The field request_names is a list collector that references the sys_user table. Here's the code I have in the "Set flow variable" step that isn't working for me. Any assistance you could provide would be greatly appreciated!
var names = fd_data._1__get_catalog_variables.service_request.request_names;
var nameArr = names.split(',');
var emailArr = [];
for (var i=0; i < nameArr.length; i++) {
var sysuser = new GlideRecord('sys_user');
sysuser.addQuery('sys_id', names[i]);
sysuser.query();
while (sysuser.next()) {
emailArr.push(sysuser.email.toString());
}
}
gs.info(emailArr);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2025 05:52 PM
@heatherdisn to be honest I can't remember exactly which flow I used this on, but I've had a look at the dates of when this question was asked and the flows I created around that time and am pretty confident that this is the right one lol
So I have a Flow variable that I called "Add user list" that is set as a string field
So for my flow I have:
- "List collector convert to array"
The action input is my variable field (u_shared_staff), from the request item (retrieved in a "Get catalog variables" action earlier in the flow) - Then I have a logic step "For each" item in the previous flow step ("List collector convert to array") on the "variable" data pill.
- Then a "Look Up record" on the sys_user table with the condition sys_id is variable_child0 (data pill) from the previous "For each" step
- Then the "Set flow variables" logic step on the "Add user list" flow variable with the following script:
var add_list = fd_data.flow_var.add_user_list;
if (add_list == '')
add_list = fd_data._15__look_up_record.record.email.toString();
else
add_list += ', ' + fd_data._15__look_up_record.record.email.toString();
return add_list;
*** Important to make sure that obviously you use your own flow variable name, but also the number of the correct look up flow step, eg: fd_data._15__look_up_record. ***
- I then outside of the for each loop add a "Fire Event" action to add the flow variables to (in my case) the Parameter 2 field, that adds the email addresses to the email notification that is sent.
I hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 05:47 AM
@Bidduam Thank you so much! That was very helpful. I'll add these steps to my flow and see if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2025 01:57 PM
Hi @Bidduam ,
I'm trying to solve the exact same problem as you. I've created a flow variable, added the step "Set flow variables" and added code inside the "Set flow variable" step to retrieve the email addresses; however, the code I've written isn't working. Any assistance or help you can provide would be greatly appreciated!
The request_names field is a list collector that references the sys_user table. Here's the code:
var names = fd_data._1__get_catalog_variables.service_request.request_names;
var nameArr = names.split(',');
var emailArr = [];
for (var i=0; i < names.length; i++) {
var sysuser = new GlideRecord('sys_user');
sysuser.addQuery('sys_id', names[i]);
sysuser.query();
while (sysuser.next()) {
emailArr.push(sysuser.email.toString());
}
}
gs.info(emailArr);