Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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.

 

 

6 REPLIES 6

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