With the ServiceNow Platform, you get access to the knowledge module. You can create one to many knowledge bases and create articles in them. If you are a knowledge creator and publish knowledge articles for the Service Portal you might get frustrated. Previewing knowledge articles with out-of-the-box functionality is bad. At least for me, it is bad… I usually want to see how my customers will see the knowledge article. But by default, I have only a preview available in the platform UI.
With each knowledge article I’ve written, my frustration grew. Therefore I wanted to change the default behavior. And it is just a simple trick with a new UI action. Of course, you can adjust the existing UI action too, but for upgradeability, I went for a new UI action.
UI Action to open knowledge article in Service Portal
My requirements:
- Additional link points to Service Portal from the related link list of knowledge articles.
- Article is saved when clicking the link.
- Knowledge Article opens in new tab for preview.
Implementation:
- Create new UI action on the knowledge table.
- Check the Form Link box.
- Add an OnClick function which is called from the script section.
- Add a Condition same as the out-of-the-box preview link.
- Update the script with the function you call.
function openRecordInServicePortal(){ var url = 'sp?id=kb_article_view&sys_kb_id=' +g_form.getUniqueValue(); g_form.save(); g_navigation.openPopup(url); }
Now you have a new link that will preview your knowledge article directly in the Service Portal.