How to display Unique(distinct) Users on List collector which is referencing to sys_user_grmember

Anil Kumar Koth
Tera Contributor

I've created a List Collector catalog variable with List table as "sys_user_grmember". Had set the Display = true for "user" field on "sys_user_grmember" table.

On service Portal, the List collector field is displaying the Users (repeatedly) who  can be member of multiple groups.

Please help me in fixing the issue to display only distinct Users even though the user is part of multiple groups?

2 REPLIES 2

Brad Warman
Giga Sage

Hi @Anil Kumar Koth . What is the business reason for using the sys_user_grmember table? If you want unique users, you'd be better off using the sys_user table. If you want to be able to select users for a group, you'd need to also filter the list collector based on a particular group.

Amit Verma
Kilo Patron
Kilo Patron

Hi @Anil Kumar Koth 

 

There are two ways to approach this :

 

1. You can change the Type of Variable to Lookup Select Box and make sure you check unique values only under Type Specifications.

2. You can write a script include to filter the unique values from the sys_user_grmember table and call this script include from a reference qualifier.

 

Refer https://www.servicenow.com/community/developer-forum/how-to-display-only-unique-values-from-the-refe...

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.