Call reports in UI page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 05:08 AM
Hi,
In embedReportById(targetSpan, reportId, additionalFilter) API given by service now additionalFilter is
not working.
- Labels:
-
Performance Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 05:48 AM
Hi Ganesh,
If you want to include the report in an ui page first of all you will have to create a gauge from that report.
You can then use a iframe tag in the ui page with src attribute as the url for the gauge
refer this for more help UI page - Gauge - Report
Mark my reply as Correct and also hit Like and Helpful if you find my response worthy.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 07:15 AM
Hi Ankur,
Thanks for the reply.
I have created UI page with following code.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:requires name="scripts/GlideV2ChartingIncludes.js" includes="true"/>
<div id="report_stuff"/>
<script>
var additionalFilter = 'priority=1';
var div = $j("#report_stuff");
embedReportById(div,'d028d98f470111002ee987e8dee49097',additionalFilter);
</script>
</j:jelly>
In the above code I have "embedReportById(div,'d028d98f470111002ee987e8dee49097',additionalFilter);" in this I am calling a report by using a sys id and I want to pass the filter to report based on user input. So 'additionalFilter' is the parameter for this API. I am able to call report but unable to set the filter based on user input.
Please see the below Service Now URL.
I am just following the steps mentioned over here.
Once I got report, Then I can call it on homepage by creating widget.
Thanks,
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 07:47 AM
Hi Ganesh,
The second parameter for the embedReportById is additional parameters. If you want to use some filter then you need to use the parameter 'sysparm_query'
Just try to use this code
embedReportById(div,'d028d98f470111002ee987e8dee49097','sysparm_query='+additionalFilter);
Mark my reply as Correct and also hit Like and Helpful if you find my response worthy.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2016 07:50 AM
Sorry it's the third parameter.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader