How to get the statistics of a report using the REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2022 12:19 PM
There are multiple reports available in ServiceNow. I know that REST API explorer returns raw data from tables that are used in the reports. The specified tables against each report contain the data for that report in raw form.
My Questions
For the above report or the reports like this that contains multiple conditions,
-
how to send the query conditions as part of the rest request?
-
how to get the statistics back in the rest response instead of the raw data?
is there any possibility that I get the above two workings?
Thanks & Regards
Jamshaid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2022 01:46 PM
Hello,
You would send a query to the table api, passing the report's query in your request. The reporting API is not your endpoint to do the query, hence why you're not getting the response you expect. I have a python script you can reference for how to do this, up to about line 27 - after that, it's manipulation of data to output to a csv file.
Please mark my answer as correct/helpful if it has helped you.
Thanks,
Logan
--
LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2022 08:34 PM
So, I would need to manually compile the required results?
If there are any specific guidelines for passing conditions parameters to the Table API, please let me know as there are not any fields available on the API page.
If the JSON needs to be parsed, please also let me know as I am not much expert in ServiceNow. I will go with the JSON then.
Does this module have anything to do with my requirements? As I am not getting it that much
Analytics and Reporting Solutions