How to add user to group (sys_user_group) using Flow designer

Kifrez
Kilo Guru

Hi, could you please let me know if you have used/added user from sys_user table to group (sys_user_group) using Flow Designer?

If so, how do you do it? What action do you use ? I can't seem to find the action

Or does anyone know how to automate adding user to a group within ServiceNow?

1 ACCEPTED SOLUTION

sk8
Kilo Expert

Hi Freddy,

To add the user to a group in Flow designer follow the below steps:

1. Add create or update record action.

2. Select Table name - Group member [sys_user_grmember].

3. Now select the group field and select the group in which you want to add a user.

4. Select the user field and select the user to add to the group.

 

Please mark answer as helpful/correct if it works for you.

Regards

Sk

View solution in original post

15 REPLIES 15

Hi,

Im just going off the top of my head at the moment but, Im pretty sure if in Step 1 you collected the necessary variables you can drag that data pill in the add field value record. Also the action would be Create/Insert not Update.

Yes, that's correct. Step 1 collected info from customer, then I'll just drag and drop to Create action.

Thanks for pointing that I need to use Create or Update instead of just Update.

I will try now 🙂

Thanks so much for your assistance.

No worries, let me know how it goes.

You can turn on scripting for that parameter and then just follow instructions that are commented there on how to access Flow variables and what to return.

Ed Hefford
Tera Guru

This is relatively simple.

The trick is to look up to see if this the sys_user_grmember record already exists otherwise you'll get duplicates when the flow executes.

Here's my flow: