- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 01:20 AM
I have a input i.e. list user type where people can select multiple users.
While I am trying to fetch the mails of the users I am not getting the result? What I am missing here?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 04:48 AM
another way is this
1) that flow action will accept input of type Records
2) then in script step simply iterate those records
3) then pass array of records as input to that action from script (I haven't tested it yet)
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
04-21-2025 01:35 AM
Hi @Manikantahere
Input type is String. So you need to convert that into array before iteration.
Try below script.
Input-> Approver sys ids. Type: String
Output-> Approver email ids. Type:String
Script:
var approverEmail = [];
var approvers = inputs.approver_sysId;
var approver_arr = approvers.split(",");
for (var i = 0; i < approver_arr.length; i++) {
var user = new GlideRecord("sys_user");
user.get(approver_arr[i]);
approverEmail.push(user.email);
}
outputs.approver_emails = approverEmail.toString();
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 01:51 AM
No luck, it is not working.
Approver input field type is List referenced to user table where as output is a string only.
Please see the below image how I am giving.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 02:06 AM
what's the input type for the input variable of script step?
since you are passing list of users, it's an array of objects I believe of GlideRecord
what came in logs?
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
04-21-2025 02:24 AM - edited 04-21-2025 02:31 AM
I don't think I can set the input type for the input variable of script step. but action input type for the approver is List reference to user table.
Yes, Its coming as Glide Record object.
But not going into for loop when I executed the script.