How to make groups visible to current lt logged in user

Priya Reddy I
Tera Contributor

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? 

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@Priya Reddy I Your question is not very clear. Could you explain it with some example here.

HrishabhKumar
Kilo Sage

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.

 

 

Priya Reddy I
Tera Contributor

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

PriyaReddyI_0-1723479052895.png

then the loggedin user can see the groups associated to them below

PriyaReddyI_1-1723479113919.png