How to make groups visible to current lt logged in user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 03:06 AM
When user logged in to servicenow and click on particular module under the application menu in scope application, then the currently logged user associated to whatever the groups, those groups should be auto populate to him/her. How to do this? Can anyone please share your ideas?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 03:11 AM
@Priya Reddy I Your question is not very clear. Could you explain it with some example here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 03:12 AM
Hi @Priya Reddy I ,
your requirement is quite achievable, but only thing confusing was " those groups should be auto populate to him/her".
If you want the logged in user to view only the groups he/she is a part of, you can do the following:
1) create a new module, on 'sys_user_groups' table.
2) create a classless script include to return the array of sys_ids of all the groups in which the logged in user is a member. (you'll have to glide the sys_user_grmember table).
3) Call this script include result in the filter condition of your newly created module.
Thanks.
Hope it helps.
Mark this helpful and Accept Solution it my response helped you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 09:16 AM
I found answer and below are the steps :
Create a module with the below details:
Link type: List of Records
Table: sys_user_grmember(give table name from where the user groups are fetching)
Arguments : &sysparm_fixed_query=user=javascript:gs.getUserID()^EQ
By using &sysparm_fixed_query we are fixing the query and the user cant remove the query conditions
then the loggedin user can see the groups associated to them below