244 views

Service Portal Knowledge search displaying attachment link 



Overview


To download an attachment directly for the search page while searching for a knowledge article or text file contained in a knowledge article, which is similar in functionality to $knowledge.do, follow the steps below to configure the Search Page widget and Search source to display the attachment.

 

Adding spAttachmentManager directive to Search Page widget

  1. Navigate to Service Portal > Widget
  2. Search for a widget named Search Page, the widget handling the searching
    Link: https://<yourInstance>.service-now.com/sp_widget.do?sys_id=b8c57073cb10020000f8d856634c9cfc
  3. In the Related list in the bottom of the page, click Edit in the Angular Providers tab.
  4. Search for spAttachmentManager and add it to the page.

Note: The search page does not need to be cloned to add the Angular Providers.

Using the spAttachmentManager directive in the Knowledge Search source

  1. Navigate to Service Portal > Portal
  2. Search for the Portal record to configure this feature. If using out of box portal, search for the record Service Portal
  3. In the related list, open the search source called Knowledge Base
    Link to the OOB Search Source: https://<yourInstance>.service-now.com/sp_search_source.do?sys_id=c6170ae86721220023c82e08f585efe6
  4. Add the following piece of code to the Search page template to use the spAttachmentManager directive: 
    <sp-attachment-manager table="'kb_knowledge'" sys-id="item.sys_id" omit-edit="true"></sp-attachment-manager>

Knowledge Search Source code demonstration

  

Article Information

Last Updated:2017-11-13 07:21:40
Published:2017-09-20