Unable to insert record in group member table through flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 04:16 AM
I have a flow designer developed for AD integration with Servicenow through AD spoke
While trying to add user to group in Servicenow instance after adding the users to the AD group I am getting an error that says "Error occurred while inserting record : null"
I have referred to the KB article available but they do not provide a clear fix as expected
I have already referred to these KBs: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0827213
And related KBs to this error but unable to find a fix
Below is the flow with error execution:
Actual flow logic:
Please let me know if you could find the issue?
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello @Radek ,
It will be helpful for me, could you please send me the details ?
Kind Regards,
Atanu Maity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
Here is a step by step guide to avoid this type of error for adding user in HR. You need HR admin but system doesn't have this role in OOB:
Mark this as helpful so others can see this!
1. Create Scheduled Script Execution, according your needs where Run as account will have the right to perform the action - see picture
 
2. Create custom Flow Designer Action to trigger this Scheduled Script Execution - see picture
 
Script for Flow Desiner Action: Execute script (Add user to group):
3. In your Flow or Sub-Flow - make sure you run this script under certain condition - example - if HR group - use this script solution - see picture
 
Please note this is kinda dirty workaround and it can be adjusted - for example you can create copy of the scheduled script execute and delete it after, so you always use unique sys_id every time the script runs. With my solution if there are 2 actions running at the same time one of them will fail most likely.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2025 10:36 AM
It's crazy that this post is from '22 and it's still an issue. I'm running into the same error. Will try what you've recommended.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2025 11:24 AM
One additional advice based on my experience, create the scheduled script as template. When you need to execute the script - create copy of this record - update values in the script - execute and delete it after.
This way you can run multiple sessions at the same time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2023 05:17 AM
Same issue here, I'll try what Olan suggested