AI Search result icons like on catalog items?

Jacob Saaby Nie
Tera Contributor

Hi everyone.

 

So when searching with AI Search, if the search results are catalog items, the search result icon next to the search result is the same icon as defined on the catalog item.

 

If I want that on another result type, what do I define in the EVAM view template? Right now I've defined a static icon. But I would like to be able to use the icons defined on the catalog item for a more dynamic result.

 

I've added Icon as a table field on the evam view config.

 

I've tried all sorts of stuff with the template JSON, but right now it looks like this:

{
    "component": "sn-search-result-evam-card", 
   "staticValues": {
      "markerType": {
            "translatable": false,
            "key": "icon"
        },
        "icon": {
            "translatable": false,
            "key": "icon"
        },
      "imageURL": {
            "translatable": false,
            "key": "columns.icon"
        },
        "imageType": {
            "translatable": false,
            "key": "image"
        }
},
    "mappings": {
        "title": "ai_search_teaser_title",
        "marker": "columns.icon",
        "summary": "ai_search_teaser_text",
        "ariaLabel": "ai_search_teaser_title"
    },
    "actionMappings": {
        "clickAction": "navigation"
    }
}

 

Can you point to a solution, or a way to go?

3 REPLIES 3

Jacob Saaby Nie
Tera Contributor

This also doesn't work. When I click the topic, I get the correct view, and I see that it has an icon.

When I go to the topic record I see that it has an icon. 

But nothing shows up in the search results.

Very frustrating, because it does on catalog items.

 

{
    "component": "sn-search-result-evam-card", 
   "staticValues": {
        "icon": {
            "translatable": false,
            "key": "icon"
        },
        "imageType": {
            "translatable": false,
            "key": "image"
        }
},
    "mappings": {
        "title": "ai_search_teaser_title",
        "summary": "ai_search_teaser_text",
        "ariaLabel": "ai_search_teaser_title",
        "imageURL": "icon"
    },
    "actionMappings": {
        "clickAction": "navigation"
    }
}

Jacob Saaby Nie
Tera Contributor

Bump

Shamus Mulhall
ServiceNow Employee
ServiceNow Employee

Hi @Jacob Saaby Nie 

It appears that you are on the right path.  I would just recommend you confirm that the supporting table field is defined and populated as you expect.  

 

Below is the example of a search result with image showing.

Screen Shot 2022-11-23 at 3.15.08 PM.png

 

This is the EVAM template supporting that result with "imageURL" set to "picture"

Screen Shot 2022-11-23 at 3.12.14 PM.png

 

The Picture column definition:

 

Screen Shot 2022-11-23 at 3.11.44 PM.png

The image that will show in the search result populated in the picture column.

 

Screen Shot 2022-11-23 at 3.10.35 PM.png