How to get the missing or error users
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 09:29 PM
Hello Team,
i am trying to upload users in azure ad using excel sheet in flow designer but few of them users are not adding and showing error " User not found" so i want to print the names of those missing users in RITM worknotes.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 09:41 PM
Please try this-
var failedUsers = "Amit Pandey, Pranay Verma"; // Assume this string is built during your flow's execution
var ritmSysId = "your_ritm_sys_id_here"; // Pass the RITM sys_id
if (failedUsers) {
var ritmGr = new GlideRecord('sc_req_item');
if (ritmGr.get(ritmSysId)) {
ritmGr.work_notes = "Failed to add/update the following users in Azure AD: " + failedUsers;
ritmGr.update();
}
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 09:57 PM
You can put your action to Add User to Group in a try block and in the if error occurs block, you can collect the failed users in a flow variable. You can then make use of Update Record to update the RITM worknotes.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
