Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Users of Scheduled Reports

MStritt
Tera Guru

Is there a way to run a report or any way to get a list of all users that are receiving a scheduled report?

1 ACCEPTED SOLUTION

Manmohan K
Tera Sage

Hi @MStritt ,

 

To get a list of users who receive reports, type sysauto_report.list in navigator  and bring users field to list view.

Then Right click on any column and export excel 

ManmohanK_0-1684997051471.png

 

View solution in original post

3 REPLIES 3

Amit Gujarathi
Giga Sage
Giga Sage

HI @MStritt ,
I trust you are doing great.

To retrieve the list of users receiving a scheduled report, you can follow these steps:

  1. Navigate to the "Reports" module in ServiceNow.
  2. Locate and open the scheduled report for which you want to view the recipients.
  3. Within the report configuration, there should be a section related to "Recipients" or "Distribution List."
  4. In that section, you should find a list of users or groups who are set to receive the scheduled report.
  5. Take note of the users or groups mentioned in the recipient list.
// Assuming you have the sys_id of the scheduled report
var scheduledReportSysID = 'INSERT_SCHEDULED_REPORT_SYS_ID_HERE';

// Query the sys_report_recipient table to retrieve the recipients
var recipientGR = new GlideRecord('sys_report_recipient');
recipientGR.addQuery('report', scheduledReportSysID);
recipientGR.query();

// Iterate through the recipients and print their details
while (recipientGR.next()) {
    var recipientUser = recipientGR.getValue('user');
    var recipientGroup = recipientGR.getValue('group');
    
    if (recipientUser)
        gs.print('User recipient: ' + recipientUser.getDisplayValue());
    else if (recipientGroup)
        gs.print('Group recipient: ' + recipientGroup.getDisplayValue());
}

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Hi Amit!

 

I am actually looking for a list/report of all users that are receiving any scheduled report. So, all scheduled reports, not just one specific report.

Manmohan K
Tera Sage

Hi @MStritt ,

 

To get a list of users who receive reports, type sysauto_report.list in navigator  and bring users field to list view.

Then Right click on any column and export excel 

ManmohanK_0-1684997051471.png