The CreatorCon Call for Content is officially open! Get started here.

Shamus Mulhall
ServiceNow Employee
ServiceNow Employee

Below is a quick example of how to add fields to the knowledge article search results card within service portal. 

 

  • Navigate to EVAM > View Definitions > View Configuration
  • Select "Knowledge Search Results" for the Global Application
  • Add 'View count' to the list of Table Fields
  • Navigate to EVAM > View Definitions > View Templates 
  • Select the "Knowledge Search Template" for the Global application
  • Update the JSON with the example below. (Note: this is showing the same additional field (view count) 2 times, this is just to demonstrate the use of the available detail fields)
    • There are 10 available details fields "detailLabelOne", "detailValueOne" > "detailLabelTen", "detailsValueTen"

 

{
    "component": "sn-search-result-evam-card",
    "staticValues": {
        "imageType": {
            "translatable": false,
            "key": "icon"
        },
        "icon": {
            "translatable": false,
            "key": "document-outline"
        },
        "detailLabelOne":{
            "key":"View Count:"
        },
        "detailLabelTwo":{
            "key":"View Count:"
        },
        "detailLabelSeparator":{
            "key":" | "
        },
        "detailPosition":{
            "key":"below"
        }
    },
    "mappings": {
        "textHeaderLabelOne": "topic", 
        "textHeaderLabelTwo": "number", 
        "textHeaderLabelThree": "sys_updated_on",
        "title": "ai_search_teaser_title",
        "summary": "ai_search_teaser_text",
        "detailValueOne":"sys_view_count",
        "detailValueTwo":"sys_view_count",
        "ariaLabel": "short_description" 
    },
    "actionMappings": {
        "clickAction": "navigation"
    }
}
Screen Shot 2023-04-11 at 5.16.35 PM.png

Comments
Shane J
Tera Guru

Your pic looks like what we see in ESC, not Service Portal.  Example from Service Portal is below, so is this really for Service Portal?

 

ShaneJ_0-1695318818754.png

 

Shamus Mulhall
ServiceNow Employee
ServiceNow Employee

Hi @Shane J yes this is for the OOTB Service Portal, this particular example shows the Utah version of the SP.

 

Screenshot 2023-10-05 at 2.43.37 PM.png

Jam2
Tera Contributor

@Shamus Mulhall we only have option for adding the card detailsValue and the textHeaderLabel is limited to three?

Shamus Mulhall
ServiceNow Employee
ServiceNow Employee

Hi @Jam2 

 

There are 10 available details fields "detailLabelOne", "detailValueOne" > "detailLabelTen", "detailsValueTen"

 

There are 3 available text header fields "textHeaderLabelOne", "textHeaderLabelTwo", "textHeaderLabelThree"

Todd Goodhew
Tera Expert

This doesn't seem to work.  I've tried this in my PDI running Vancouver.  Has something changed?

Version history
Last update:
‎04-11-2023 02:23 PM
Updated by:
Contributors