logo

NJP

Changing the AI Search navigation on Employee Center [How-To]

Import · Aug 04, 2022 · article

In this technical How To article, we'll cover the configuration steps needed to change the behavior of the navigation when a user clicks on a search result.

In this use case, the current behavior for Knowledge articles is that the KB sys_id is used to navigate to the KB page.

We want to change the URL to use the KB number (for example KB000001) instead, so the new URL uses the sysparm_article URL parameter instead of the sys_id.

Note that in this use case, the widget on the KB page is built OOB to handle both the URL with the sys_id and the KB number so we'll focus on the AI Search configuration without reworking any widget.

image

Finding the EVAM configuration

Navigate to the Portals list, then open the Employee Center record.

Scroll to the bottom of the form and open the Search Results Configuration record.

image

On this page, open the EVAM View Config Bundle M2Ms tab and open the Taxonomy Portal Search Bundle record (click on the label, not the icon).

image

Scroll through the list and open the Taxonomy - Knowledge Search Results record.

image

Tip 1: EVAM View Config drives how search results are displayed and what actions can be taken.

To find which EVAM View Config record drives the search results you're looking to modify, filter by table and look at the Condition field. If there aren't any records, it means the Default Search Results record will be used.

Tip 2: If you are creating new EVAM View Config records, make sure they are part of a Bundle and linked to the Portal via the EVAM Definition.

On the Taxonomy - Knowledge Search Results record form (it's an EVAM View Config record), make sure that the Number is available in the list of Table Fields.

image

image We've identified the existing EVAM configuration, now we are ready to modify it to fit our needs.

Changing the EVAM configuration

From the Taxonomy - Knowledge Search Results record form, scroll to the EVAM View Config Action Assignment M2Ms related list and open the navigation record by clicking on the label (not the icon). To make the next few steps more manageable we recommend opening that record in a new browser tab.

image

The Navigation record is opened (it's an Action Assignment record), then open the record in the Specify client action field. To make the next few steps more manageable we recommend opening that record in a new browser tab.

image

The Navigation record is opened in a new tab (it's an Action Payload Definition record). Change the Key and Label fields to match the picture below. Then click Insert and Stay to create a new record.

Key: KB_NAVIGATION

Label: kb_navigation

Then, change the Payload field and Save.

Payload: { "table": "{{table}}", "sysparm_article": "{{number}}", "url": "{{navigation_url}}"

}

image

Make sure that the Action Payload Mappings and Action Payload Fields show the new Payload parameters.

image

Go back to the previous browser tab showing the Navigation record (the Action Assignment record). Change the Action label, Action name and Specify client action and click Insert and Stay.

Action label: KB NavigationAction name: kb_navigation

Specify client action: kb_navigation

image

Go back to the previous browser tab showing the Taxonomy - Knowledge Search Results record form (it's an EVAM View Config record), scroll to the EVAM View Config Action Assignment M2Ms related list, click Link Existing and select the kb_navigation Declarative Action then Submit.

image

The Taxonomy - Knowledge Search Results record has now 2 records on the EVAM View Config Action Assignment M2Ms related list.

image

While still on the Taxonomy - Knowledge Search Results record form, open the record in the View Template field.

image

Modify the value actionMappings in the Template field.

image

Template: "actionMappings": { "clickAction": "kb_navigation"

}

image We've modified the EVAM configuration to change the parameters for the action on click, now we can map it.

Changing the navigation behavior

Navigate to Search Results Actions and open the Knowledge record for Employee Center.

image

Edit the Action name value to be kb_navigation, then Save.

image

Check that the parameters we created for the Action Payload Definition record are now displayed in the Payload query parameters field.

image

Open Employee Center and start a new search, open a KB result and notice that the URL now uses the number parameter.

image

image We now use the new navigation behavior for the search results on the Employee Center.

References

image Entity View Action Mapper Define an AI Search Results Action

Check out the AI & Intelligence forum to get the best content about ServiceNow's AI products!

image

View original source

https://www.servicenow.com/community/intelligence-ml-articles/changing-the-ai-search-navigation-on-employee-center-how-to/ta-p/2307854