Not able to add user in the HR Group through Flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Team,
I’m facing an issue while adding a user to one of the HR groups through Flow Designer.
In the flow, I am trying to add a user to the IGA group, which is an HR group. However, I’m consistently getting an error during this step.
Sometimes Flow Designer shows that the record was created successfully, but when I check the group members, the user is not actually added.
Could you please help me understand why this is happening and how to fix it?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Steps
1) create fresh sys_user and give that user hr admin role
2) then create scheduled job which runs as This above user and not System Administrator
3) then create custom flow action and use script to make this job run
var jobRec = new GlideRecord("sysauto_script");
jobRec.addQuery("name", "Scheduled Job Name");
jobRec.query();
if (jobRec.next()) {
gs.executeNow(jobRec);
}
4) then call this custom flow action in your main flow
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi @Ankur Bawiskar
The group and user will be selected through the catalog item, and the flow is attached to that catalog item. So how can we pass the selected user and group to the scheduled job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
you can't call scheduled job and pass values
then try this
-> from your flow call custom flow action and pass the user and group to it
-> in custom flow action grab these inputs and call script action using gs.eventQueue() and pass those parameters
// group and user will come as inputs to flow action from main flow
gs.eventQueue('eventName', group, user);
-> in script action impersonate some HR Admin user and then use GlideRecord to insert value
var impUser = new GlideImpersonate();
impUser.impersonate("62826bf03710200044e0bfc8bcbe5df1");
var group = event.parm1;
var user = event.parm2;
// GlideRecord Here
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader