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

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

How about making the report on the table "Sys_user_has_role" instead?


Mike Allen
Mega Sage

You can try getRoledUsers():


find_real_file.png


Why do this when there already is a table for it?


Hi Goran,



yes there is sys_user_has_role table. but if your user have 4 roles in the system then there will be 4 records for that user in that table. but my requirement was to get only one record for 1 user not matter how many role he has. method from mike worked well.