Can you create hyperlinks to a dashboard or a report on a homepage?

Nilan1
Mega Expert

I have created multiple dashboards and reports.  Can I create a list of hyperlinks on a homepage to point to these reports or dashboards?

I want to avoid sending a list of URLs to users.

1 REPLY 1

athm
Tera Guru

Hi Nilan, 

 

You can try the below approach to present the users with a list of url's directing to your specific reports

Step 1. Create a UI Page and place your report urls in it

Ex: UI Page name: 'showOnHomepage'

UI Page HTML as

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<a href="/nav_to.do?your_report_or_dashboard_url_here" target="_blank">Report_Name_Here</a>
</j:jelly>

NOTE: Remember to add the attribute target="_blank" to the anchor element, for some reason without it the system is not redirecting as expected in case of clicking on a link from home page

 

Step 2. Create a custom widget (System UI > Widgets) 

Ex: Widget Name: 'showOnHomepage_Widget' and the script as below

function sections() {
    return {
        'showOnHomepage_Widget': { 'uiPageName' : 'showOnHomepage'},
     
    };
}

function render() {
    var uiPageName = renderer.getPreferences().get("uiPageName");
    return renderer.getRenderedPage(uiPageName);
}

function getEditLink() {
    return "sys_ui_page.do?sysparm_query=name=" + renderer.getPreferences().get("showOnHomepage");
}

Step 3. Create a new homepage or edit an existing homepage, 

You should now be seeing the widget created in step 2 as 'showOnHomepage_widget' in the selection choices

 

NOTE: I have used the below article to achieve the above, could be helpful to you for more information.

Adding UI Page to a homepage

(https://docs.servicenow.com/bundle/jakarta-platform-user-interface/page/use/dashboards/task/create_widget_displays_webpage.html)

Hope this helps you Nilan.