create a report using scripting

Sai104
Tera Contributor

Hello,

We would like to write fix script to generate a report. Is it possible to create a report using scripting?

Many Thanks in Advance!

 

Regards,

Sai.

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sai,

Why to create reports from script?

If you already have report and have configured the Scheduled Report which would send the report to users as attachment then here is the script to run that

var scheduleReport = new GlideRecord('sysauto_report');

scheduleReport.get('scheduled_email_report_sys_id');

SncTriggerSynchronizer.executeNow(scheduleReport);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sai,

Why to create reports from script?

If you already have report and have configured the Scheduled Report which would send the report to users as attachment then here is the script to run that

var scheduleReport = new GlideRecord('sysauto_report');

scheduleReport.get('scheduled_email_report_sys_id');

SncTriggerSynchronizer.executeNow(scheduleReport);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

Is it possible to attach the Report as a pdf file?
I already have a Report, I just have to run it and attach it to the case that will be created using scheduled job.

Hi,

I doubt this is feasible

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Adam Stout
ServiceNow Employee
ServiceNow Employee

Depending on your use case, you may want to look at the Performance Analytics Academy session we did last year on building a Burst Reporter with Flow Designer.  https://community.servicenow.com/community?id=community_blog&sys_id=43455acedb30ac1011762183ca961983