- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 01:24 PM - edited 04-10-2025 01:25 PM
Does there exist or is there a way to setup, a keyboard shortcut to logout of the Employee Portal?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 12:13 AM - edited 04-11-2025 11:35 PM
Hello @Joel Bowles ,
You can do this as follows:
1) Create a UI Script
Name: EC Logout keyboard shortcut
UI Type: All
Script: paste the following code, and adjust the condition for the desired key combination as needed
document.addEventListener('keydown', e => {
// check for key combination ALT + SHIFT + L
if (e.code === 'KeyL' && e.altKey && e.shiftKey) {
window.location.href = '/logout.do?sysparm_goto_url=/esc';
}
});
2) In the Theme record for Employee Center ("EC Theme" by default), create a new JS Include that refers to the above UI Script
If you now open Employee Center and press ALT + SHIFT + L you will be logged out of ServiceNow.
Regards,
Robert

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 06:24 PM
@Joel Bowles ServiceNow does not provide a native keyboard shortcut to log out of the Employee Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 12:13 AM - edited 04-11-2025 11:35 PM
Hello @Joel Bowles ,
You can do this as follows:
1) Create a UI Script
Name: EC Logout keyboard shortcut
UI Type: All
Script: paste the following code, and adjust the condition for the desired key combination as needed
document.addEventListener('keydown', e => {
// check for key combination ALT + SHIFT + L
if (e.code === 'KeyL' && e.altKey && e.shiftKey) {
window.location.href = '/logout.do?sysparm_goto_url=/esc';
}
});
2) In the Theme record for Employee Center ("EC Theme" by default), create a new JS Include that refers to the above UI Script
If you now open Employee Center and press ALT + SHIFT + L you will be logged out of ServiceNow.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 10:12 AM
Thanks Robert! For whatever reason that script didn't seem to work, but after modifying it slightly this worked:
(function() {
document.addEventListener('keydown', function(e) {
if (e.altKey && e.shiftKey && e.code === 'KeyL') {
window.location.href = '/logout.do';
}
});
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2025 11:38 PM
Hello @Joel Bowles ,
Thank you for the feedback. I did some reading and found that the "keyCode" property that I used in my code is marked as obsolete, so maybe that's the reason why it did not work for you. I have updated the code in my earlier response to use the "code" property instead, just like you did.
Regards,
Robert