how to get data from created report using API?

maxim_radetsk
Kilo Explorer

Using the Table API (GET), we can obtain the data from the Incidents table.
Table API (GET) from sys_report table get only the data of the displayed graph in the report (for example "type": "line_bar", "chart_border_color" "," y_axis_title_size ":" 12 ").
How to get data (2017-12-08 = 2 incidents, 2017-12-11 = 1 incident...) from created "Test Report_6" report using API?
60452faaa2c3ab2fe9559084f9d999db

10 REPLIES 10

Dave Smith1
ServiceNow Employee
ServiceNow Employee

Why fetch the data from a report when you could fetch the data from the data source itself?



Reports are about data presentation, not a data source.


I need to get grouped data by month(count of incents by each month of one year), So if we have 1 million incidents the fetching all this data from API will not good solution...


The REST API also includes an Aggregate api that would allow you to get the grouped data as described above. 

This may be a bit trickier and more complex to use but should give better performance for getting just aggregated data.

https://developer.servicenow.com/app.do#!/rest_api_doc?v=kingston&id=r_AggregateAPI-GET

 

This is a pretty legitimate use case, especially if reporting against Request Item variables.

Check out my Consultant's Survival Guide
https://youtube.com/watch?v=zYi8KhP9SUk