to Change the OOB Behaviour of Service Portal For list view of Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 09:36 AM
i want to change the OOB behavior. I want to customize it such that, I will see this as in native view where the CI field opens the CI record and the User field will field opens the user records.
how can we achieve it
i have found if i can change the Data Table from URL Definition widget but i have no idea where to change, please guide me for the same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 11:02 AM
Go to Service Portal > Widgets
Search for "Data Table from URL Definition" this is a read-only OOB widget, so you need to clone it.
Modify the Link Behavior you need to edit the Server Script and HTML Template to enable links to native views.
Update the link logic. Now go to your cloned widget and go to "HTML Template" tab. Locate the correct ng loop where each item is displayed and replace the values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 12:05 AM
it is cloned but i have no idea where i need to change for the same, please guide me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 12:19 AM
Step 1: Find and edit the widget
Navigate to Service Portal → Widgets.
Search for Data Table from URL Definition.
Clone this widget first (recommended, so you don’t lose the OOB behavior).
Open your cloned widget to customize.
Step 2: Change the link behavior
Inside the widget, you’ll see server script and client script.
The key part is usually in the template or client script that builds the link for each cell.
By default, it builds a URL like:
/sp?id=form&table=cmdb_ci&sys_id=...
You can change it to open the native view by making the link:
https://INSTANCE.service-now.com/cmdb_ci.do?sys_id=...
But instead of hardcoding INSTANCE, use:
var instanceUrl = $window.location.origin.replace('/sp', '');
So your click action could look like:
window.open(instanceUrl + '/' + tableName + '.do?sys_id=' + sysId, '_blank');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2025 03:25 AM
I have changed it but seems due to hardcode it is not working as expected i want it dynamically please guide me with this below client code where i need to change