Automate HR group member maintenance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:23 PM
Hi Community,
I'm automating HR group membership:
- User requests group access via catalog item.
- Group manager approves (configured with Service Activity and working fine).
- Flow adds user to group (not working).
The flow fails when creating a record in sys_user_grmember. I suspect permissions.
- Problem 1: "Run as System User" fails.
- Problem 2: "Run with role" - "HR Admin" role is missing from the role selection list (HR Basic/Manager are visible).
I've opened a support ticket for these issues.
Question: Any alternative flow designs or solutions (business rule, etc.) for automating sys_user_grmember creation? Why might "System User" fail and "HR Admin" be invisible?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2025 08:50 PM
Hi @Kohei Tominaga1 ,
Please refer to this Article : https://www.servicenow.com/community/developer-articles/how-to-use-automatic-group-member-management...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
@Kohei Tominaga1 Did you manage to find any solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello @Kohei Tominaga1 ,
You can create Custom Script action in Flow Designer
Instead of using the native "Create Record" flow step, add a Custom Script Action inside your Flow. Use standard JavaScript to insert the record:
Pass two variable details
1.User Sys ID
2. Group Sys ID
Javascript
var gr = new GlideRecord('sys_user_grmember');
gr.initialize();
gr.user = inputs.user_sys_id; // add your user input variable
gr.group = inputs.group_sys_id; // add your group input variable
gr.insert();
Note: Ensure your HR Scope has Can Create permissions allowed for the sys_user_grmember table in your Application Access settings.
If my response helped you, please click on accepted the solution and consider giving it a thumbs-up👍. This helps others find the solution faster and keeps the community thriving. Thank you for your support!😊
Thanks & Regards ,
Supriya Waghmode |ServiceNow Community Rising Star 2025⭐
www.linkedin.com/in/supriya-waghmode