GET users with any role -REPORT.

Rushit Patel2
Tera Guru

Hi all,

i want to create a report which shows   list of all users with atleast 1 role in the table. i tried creating database view but it is giving duplicate user records.

i also tried creating report on user table with query like this sys_id is one of   javascript:my script.

now problem is that it returns around 6600 records only. my best guess is.. field which there to hold all sys_id(right side of one of condtion) has some max limit.

i have more than 200000+ records. so it wont work.

can any one suggest any other way?

ps: i can export that data with duplicate records and have some logic to make it distinct on EXCEL.that seems the last option.

1 ACCEPTED SOLUTION

Mike Allen
Mega Sage

You can try getRoledUsers():


find_real_file.png


View solution in original post

10 REPLIES 10

Ahh okey.. I just group by user, but then it kind of depends on what you want to do with the list later


Hi Mike,



that was Super awsme! thank you very much.



i have follow up question. how to find these kind of methods? it doesn't have prefix like gs. are these documented somewhere?




Thanks again.


found it. it is Global Business rule i guess.


Yeah, it is a global business rule.   There are a few things that I remember from pre-Aspen days that help when I am trying to do things today.


Is this something from the earlier versions of ServiceNow. I never heard about making functions inside a global business rule before.. What the benefits of doing it like this?