Return List of sys_user in Flow Designer Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 07:08 PM
I am having an issue on how to return a list of referenced users in my flow designer action.
I have 2 inputs for querying, 1 asking for roles (array of strings), and 1 asking for the project (string) they are assigned to. I have the script look up the users and get their sys_id's for each user. This all works.
The issue I am having is how to return the values. My output is current a "List" to sys_user and I populate that by my script variable called "users"
I have tried passing
164ad5c6519110107f610b038645ddb3,3a98e903810d50107f612b41b4439bef
And it does not display the users.
I have tried passing
sys_IN164ad5c6519110107f610b038645ddb3,3a98e903810d50107f612b41b4439bef
This does not display the users.
I have made the output field a reference to sys_user and returned a single user of
164ad5c6519110107f610b038645ddb3
And it displays the user Andrew Anderson
So how are you supposed to pass a list of sys_id's for a List Reference Output field?
Here is my code for anyone wanting to see it for my Action Script Step
var gr = new GlideRecord('x_snc_authorizatio_stakeholders');
gr.addQuery("project_id.project_id", inputs.project_id);
for ( index in inputs.roles ){
role = inputs.roles[index]
if(index == 0){
var rq = gr.addQuery('role.role_name', role);
}
else{
rq.addOrCondition('role.role_name', role);
}
}
gr.query();
var sys_ids = [];
while(gr.next()) {
sys_ids.push(gr.users.sys_id);
}
outputs.users = sys_ids.join(",");
Here is my Output screenshots

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 11:46 PM
Hi Kyle,
If you pass on a project id in the script and try in background script, is it returning expected value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 11:53 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2020 02:00 AM
Hi Kyle,
If I understood correctly, you wanted to do add the output of sys_id to a list field type (glide_list) in a record. If so,
change the output type to string -
Add the output to the list type in the record:
Result:
Kindly mark my response correct and helpful if my suggestion resolved your query,
Thanks
Murali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2020 09:20 AM