Getting AD v2 Spoke action error for "Remove User from Groups"

gjz
Mega Sage

Hello, I'm hoping someone can help me with a cryptic error.

 

I have a flow that uses Microsoft Active Directory v2 Spokes to

    1. Create a new user

    2. Adds the user to a specific group and makes it the primary group for the new user

    3. Removes the user from the default primary group

 

The actions for steps 1 & 3 are OOB, step 2 is a custom function that is working.

When I run the OOB action "Remove User from Groups" with a single group, it works just fine.  When I use the same action in a flow, it fails with the following error, which doesn't make sense to me.

 

gjz_0-1730761488413.png

 

Can anyone think of why this weird error is happening?

 

When I run the action by itself, I enter the UserID and name of the group.  This always work.

 

When I run the flow, I use a flow variable to pass in the UserID and typed in the group name in the "Group Name 1" field.  I left the Group Names array empty, it doesn't seem to need a value - at least, it doesn't show up when testing the action.  I also added a pause for 5 seconds between this action and the previous action to make sure AD is finished with the previous step - it still fails.

 

Any ideas?

3 REPLIES 3

AnveshKumar M
Tera Sage
Tera Sage

Hello @gjz ,

 

Is it possible for you to share the screenshots of flow and the remove user action configuration in the flow?

 

 

Thanks,
Anvesh

I stumbled on the answer - it's because AD hadn't caught up with the Flow.  I added a 2 minute wait (5 seconds wasn't enough) between Setting the primary group and removing the default primary group - now it works.

Great @gjz .

Enjoy exploring the depths of ServiceNow flow designer and building miracles.

Thanks,
Anvesh