How to prevent duplicate records in sys_user_grmember?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We are seeing duplicate records in the sys,user,grmember table where the same user is added to the same group multiple times. This usually happens due to automated scripts, Flow Designer actions, or integrations that add group members without checking existing membership first.
What is the recommended best practice in ServiceNow to prevent these duplicate user and group records from being created?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@AyushK859766811 - In ServiceNow, the best practice is to prevent duplicates before they’re created, not clean them up later. Always check if the user is already in the group before inserting, and back that up with a Before Insert business rule or a uniqueness constraint on user plus group. That way, scripts, flows, and integrations can’t accidentally add the same membership twice.
