Flow Designer Issue

ServiceNow Use6
Tera Guru

Hi,

 

When a user is created, it should automatically assign a group any. I am not able to set the logic to sys_user_grmember table. Kindly help.

 

1.jpg

 

2.jpg

 

Regards

Suman P.

 

 

2 ACCEPTED SOLUTIONS

Hemanth M1
Giga Sage
Giga Sage

Hi @ServiceNow Use6 ,

 

Here is how your flow looks. Are you getting any errors or warnings during execution?

 

And also what's the use case here, we can suggest a better approach because just creating a user without any validation is not a good approach!

 

HemanthM1_0-1763968619932.png

 

HemanthM1_1-1763968648543.png

 

Result:

HemanthM1_2-1763968873556.png

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

View solution in original post

Hi @ServiceNow Use6 

After creating user, you should check in sys_user table if record exists not in sys_user_grmember table.

sys_user_grmember is table where user and group relations are stored. 

 

I have tried to replicate what you are trying to do, you can follow these steps for understanding basic gist of it and later tweak as per your convenience

 

Step 1: Trigger user is created

 

Mohammed8_0-1763972712334.png

 

Step 2 : look up record on sys_user table to check if user exists or not 

 

Mohammed8_1-1763972748551.png

 

Step 3 if condition to check if look up record is not empty

 

Mohammed8_4-1763973216599.png

 

Step 4: Assign user to group using sys_user_grmember table

 

Mohammed8_5-1763973277322.png

 

Step 5 Testing : using + sign create a new user record and run test

 

Mohammed8_6-1763973326512.png

 

step 6:  flow works fine and completed, the above steps work

 

Mohammed8_7-1763973377788.png

 

if you find the answer useful, please mark it as solution accepted/helpful 

 

Thanks and regards,

Mohammed Zakir

View solution in original post

7 REPLIES 7

Hi @ServiceNow Use6 ,

 

You shouldn’t be looking in the "sys_user_grmember" table because you are creating a brand new user, and you won’t find that user in "sys_user_grmember". Instead, you should check the "sys_user" table (as I am doing here) to make sure the user was created and exists in the "sys_user" table, and then add the user to the group.

 

Here my second and third step details

#2

HemanthM1_2-1763972142298.png

 

#3

HemanthM1_1-1763971851954.png

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Hi @ServiceNow Use6 

After creating user, you should check in sys_user table if record exists not in sys_user_grmember table.

sys_user_grmember is table where user and group relations are stored. 

 

I have tried to replicate what you are trying to do, you can follow these steps for understanding basic gist of it and later tweak as per your convenience

 

Step 1: Trigger user is created

 

Mohammed8_0-1763972712334.png

 

Step 2 : look up record on sys_user table to check if user exists or not 

 

Mohammed8_1-1763972748551.png

 

Step 3 if condition to check if look up record is not empty

 

Mohammed8_4-1763973216599.png

 

Step 4: Assign user to group using sys_user_grmember table

 

Mohammed8_5-1763973277322.png

 

Step 5 Testing : using + sign create a new user record and run test

 

Mohammed8_6-1763973326512.png

 

step 6:  flow works fine and completed, the above steps work

 

Mohammed8_7-1763973377788.png

 

if you find the answer useful, please mark it as solution accepted/helpful 

 

Thanks and regards,

Mohammed Zakir

@ServiceNow Use6 If you are creating a new user, it wont be present in any group.

I dont think you need a lookup step.

 

It should be create user and then add user to group (create record in sys_user_grmember).


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn