- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2021 11:32 PM
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?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2021 11:48 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2021 06:38 AM
To change the display value of a table go into the table it self and select "Display" as true on the field (in this case Name) you want to be shown when that table is referenced in reference fields.
So go in the Table of tables, find the sys_user_group table. Open that record, then find the name row and then in the display column change it to true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2021 05:37 PM
This worked. thanks so much.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 07:34 AM
Simple and perfect, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2021 03:52 PM
Hi Freddy,
Here is a sample script to add a user to a group, which you can just copy/paste into the Script step in the flow designer.
var gr = new GlideRecord("sys_user_grmember");
gr.initialize();
gr.setValue("user", "put sys_id of user here");
gr.setValue("group", "put sys_id of group here");
gr.insert();
Here is a link explaining the Script step
https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/flow-designer/reference/javascript-step-action-designer.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2021 04:21 PM