Enable "Record" and “View All” onClick Navigation for Platform Analytics Dashboards in Workspaces
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited 3 hours ago
Overview
When working with Platform Analytics dashboards inside Service Operations Workspace (SOW), a common requirement is to:
Redirect users to the record form when a row is clicked
Redirect users to a filtered list view when the “View All” button is clicked
Out of the box, dashboards do not always provide flexible navigation for these interactions specially for List/SimpleList Widgets/reports.. This article explains how to achieve both using UI Builder event handling and client scripts.
Step-by-Step Implementation
1. Open Service Operations Workspace in UI Builder
Navigate to UI Builder
Go to Experiences
Open Service Operations Workspace
Locate the variant page for the dashboard where you want to enable redirection
2. Check if the Variant Is Editable
If the variant is editable, you can proceed directly
If not editable:
Duplicate the variant
Work on the duplicated version
3. Create a Client Script
Inside the variant page, add a new Client Script as shown in the below image.
Give it a meaningful name (example:PA Dashboard Navigation Handler)
4. Add the Client Script Code
Use the following script to handle both View All and Row Click events:
/**
* {params} params
* {api} params.api
* {any} params.event
* {any} params.imports
* {ApiHelpers} params.helpers
*/
function handler({
api,
event,
helpers,
imports
}) {
// Handle "View All" button click
if (
event.payload.componentProps.showViewAll &&
event.payload.eventOrigin === "NOW_RECORD_LIST_CONNECTED#VIEW_ALL_CLICKED"
) {
helpers.navigate.to(
"simplelist",
{
table: "incident"
},
{
query: "active=false",
listTitle: "P3 Incidents"
}
);
}
// Handle row click – navigate to record
if (event.payload.eventOrigin === "NOW_RECORD_LIST_CONNECTED#ROW_CLICKED") {
helpers.navigate.to("record", {
table: event.payload.table,
sysId: event.payload.row.sys_id.value
});
}
}5. Attach the Script to the Dashboard Component
Click on the dashboard component
Go to Events as shown in the below image
Under “Dashboard Widget Clicked” event, attach the client script to by clicking on Add handler as in the shown below image
Select Execute Client Script
Choose the client script you created
6. Test the Functionality
Open the target dashboard
Click:
A row → should open the record form
View All → should redirect to the filtered list view
Validate query, list title, and navigation behavior
Important Notes (Very Important ⚠️)
Payload Differences Across Versions
The event.payload structure can differ based on ServiceNow versions.
For example:
Zurich
event.payload.componentProps.showViewAllYokohama
event.payload.componentProps.hideViewAll
Best Practice
Always inspect the payload before writing conditions by logging the event payload in the script(client script or event script):
console.log(event.payload);Use this to:
Verify available keys
Confirm eventOrigin
Adjust conditions based on your instance version
- 105 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
it worked fine for me when I opened record in SOW in dashboard data visualization
see this gif
I believe it would work when View All is clicked
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Yes Ankur, what you’re showing is OOB behaviour for "non-list/non-simplelist widgets/reports" and it works as expected. However, when we add the List / Simple List widget to a dashboard, the "record reference links" and the "View All" action do not work as expected.
