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

RaghavSh
Mega Patron

@ServiceNow Use6 once the user is created, your second step should not be lookup , it should be create record.

 

In the create record step, you need to select the table as sys_user_grmember and select value of user from previous step(create user) and select group as per your requirement( which you want the user to be member of).


Please mark the answer correct/helpful accordingly.

 


Raghav
MVP 2023
LinkedIn

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

Mohammed8
Mega Sage

Hi @ServiceNow Use6 ,

1) No need for a Look Up Record action for sys_user_grmember. if you want u can validate for user created, by using lookup record for user record created
2) then on the next step after look up record found for user, you can use a Create Record action with the table set to sys_user_grmember
3) For the User field, insert the data pill from the lookup record of user  (dot walk to the user’s  sys_id).
4) Then select the group you want the new user to be added to

 

If you find this answer useful, please mark it as solution accepted/helpful

 

Thanks and regards,

Mohammed Zakir

ServiceNow Use6
Tera Guru

Hi @Hemanth M1,

 

I have a question, actually i manually did it before i attempt in flow designer. I created a user in user table and then i checked for the record in sys_user_grmember table but i can't find the record. In your second step, user will not be found right.

 

@Mohammed8 asked me to selct the sys_id corcerning the first step or the trigger step, as soon as i do it, it is changing to user table and not living in sys_user_grmember table anymore.

 

Regards

Suman P.