Email SNOW report to users in email field

VenkatU
Tera Contributor

Hi Team,

 

I have a SNOW report which needs to be emailed to specific users based on the email listed in the email field of the report. Can someone guide me on to get it done ?

 

Venkat.

2 REPLIES 2

Robbie
Kilo Patron
Kilo Patron

Hi @VenkatU,

 

@Sagar Pagar has provided a great post and link with step by step instructions how this can be implemented below (Kudos):

https://www.servicenow.com/community/platform-analytics-articles/scheduling-a-report-for-dynamic-rec...

 

Additionally, check the following video from the ServiceNow Devs Live Happy hour coding discussing this found here:

https://www.youtube.com/watch?v=LIJnhdQBsXw

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.





Thanks, Robbie

 

Topic: On this episode, we will continue to explore what's possible with of dynamic scheduled reports. Stop including extra people on your scheduled reports (you know, just in case!) and only send them to the people, teams, and managers that have items in the report. Crack a beverage and come join

VenkatU
Tera Contributor

Hi Robbie,

 

Thank you for the help. I followed the steps but its not working.  Request help.

 

var scheduleReport = new GlideRecord('sysauto_report');  // glide the Scheduled report
scheduleReport.get("I entered my report sys id"); //Sys ID of your schedule Report
 
var tablename = scheduleReport.report.table;
var query = scheduleReport.report.filter;
var users = '';
 
//Execute the report as a GlideRecord with the set table and condition
 
var gr = new GlideRecord(tablename);
gr.addEncodedQuery(query);
gr.query();
while (gr.next()) {
users += ',' + gr.managed_by;
 
current.user_list = users;
 
}
 
 
current.update();