
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 03:40 PM
What is the fastest / easiest / best way to navigate from a Form to a List View showing that same record?
Very often this is useful because not all fields may be configured to show up on the form, but they may be in the List View columns. And I'm sure there are many other reasons.
I will post my solution below, but I would love to hear if any others have a better solution for this. Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 03:51 PM - edited 01-05-2024 06:59 AM
To achieve this with a single click, I created a "Bookmarklet", SIMILAR to the very useful one described here:
- https://snprotips.com/blog/rvicenowprotips.com/2015/10/bookmarklet-load-current-page-in.html
- https://www.servicenow.com/community/developer-blog/useful-bookmarklet-quot-nav-to-quot/ba-p/2275516
- https://subscription.packtpub.com/book/cloud-and-networking/9781785883323/1/ch01lvl1sec11/content-fr...
javaXscript:(function(){var myURL = window.location.href;myURL = decodeURIComponent(myURL);if ( myURL.indexOf("service-now.com/") < 0 && myURL.indexOf('wwwsnow') < 0 ){alert("That only works on ServiceNow pages.");return;}if ( myURL.indexOf("_list.do") > 0){alert("Looks like you are already in a List View, not a Form.");return;}var indexOfColonSlashSlash = myURL.indexOf("://");var indexOfFunctionPath = myURL.indexOf("/", indexOfColonSlashSlash + 3) + 1;var domainPath;var remainder;var table;var indexOfSysId;var indexOfDotDo;var indexOfDotDoTwo;domainPath = myURL.slice(0, indexOfFunctionPath);remainder = myURL.slice(indexOfFunctionPath);indexOfDotDo = remainder.indexOf(".do?");table = remainder.slice(0, indexOfDotDo);if (table == "nav_to"){indexOfURI = remainder.indexOf("uri=");indexOfDotDoTwo = remainder.indexOf(".do", indexOfURI);table = remainder.slice(indexOfURI + 5, indexOfDotDoTwo);}indexOfSysId = remainder.indexOf("sys_id=") + 7;indexOfCharAfterSysId = remainder.indexOf("&", indexOfSysId);if (indexOfCharAfterSysId == -1){sysId = remainder.slice(indexOfSysId);}else{sysId = remainder.slice(indexOfSysId, indexOfCharAfterSysId);}var navToDoPrefix = "nav_to.do?uri=/";var listSuffixAndQueryPrefix = "_list.do?sysparm_query=sys_id=";var completeNewPath = domainPath + navToDoPrefix + table + listSuffixAndQueryPrefix + sysId;window.location.href = completeNewPath;})();
Remove the "X" in the word javaXscript, and you will be good to go.
Important: This code MUST NOT contain any // comments or it will fail in Chrome!
To get this to work, just EDIT any existing Web Browser Bookmark button, and paste the code in the URL field. I called my button "List". You can name yours whatever you want.
Then with the click of a button, you can navigate from a form page like this:
to the List View containing that record, like this:
Is this Useful?
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 03:51 PM - edited 01-05-2024 06:59 AM
To achieve this with a single click, I created a "Bookmarklet", SIMILAR to the very useful one described here:
- https://snprotips.com/blog/rvicenowprotips.com/2015/10/bookmarklet-load-current-page-in.html
- https://www.servicenow.com/community/developer-blog/useful-bookmarklet-quot-nav-to-quot/ba-p/2275516
- https://subscription.packtpub.com/book/cloud-and-networking/9781785883323/1/ch01lvl1sec11/content-fr...
javaXscript:(function(){var myURL = window.location.href;myURL = decodeURIComponent(myURL);if ( myURL.indexOf("service-now.com/") < 0 && myURL.indexOf('wwwsnow') < 0 ){alert("That only works on ServiceNow pages.");return;}if ( myURL.indexOf("_list.do") > 0){alert("Looks like you are already in a List View, not a Form.");return;}var indexOfColonSlashSlash = myURL.indexOf("://");var indexOfFunctionPath = myURL.indexOf("/", indexOfColonSlashSlash + 3) + 1;var domainPath;var remainder;var table;var indexOfSysId;var indexOfDotDo;var indexOfDotDoTwo;domainPath = myURL.slice(0, indexOfFunctionPath);remainder = myURL.slice(indexOfFunctionPath);indexOfDotDo = remainder.indexOf(".do?");table = remainder.slice(0, indexOfDotDo);if (table == "nav_to"){indexOfURI = remainder.indexOf("uri=");indexOfDotDoTwo = remainder.indexOf(".do", indexOfURI);table = remainder.slice(indexOfURI + 5, indexOfDotDoTwo);}indexOfSysId = remainder.indexOf("sys_id=") + 7;indexOfCharAfterSysId = remainder.indexOf("&", indexOfSysId);if (indexOfCharAfterSysId == -1){sysId = remainder.slice(indexOfSysId);}else{sysId = remainder.slice(indexOfSysId, indexOfCharAfterSysId);}var navToDoPrefix = "nav_to.do?uri=/";var listSuffixAndQueryPrefix = "_list.do?sysparm_query=sys_id=";var completeNewPath = domainPath + navToDoPrefix + table + listSuffixAndQueryPrefix + sysId;window.location.href = completeNewPath;})();
Remove the "X" in the word javaXscript, and you will be good to go.
Important: This code MUST NOT contain any // comments or it will fail in Chrome!
To get this to work, just EDIT any existing Web Browser Bookmark button, and paste the code in the URL field. I called my button "List". You can name yours whatever you want.
Then with the click of a button, you can navigate from a form page like this:
to the List View containing that record, like this:
Is this Useful?
Thanks.