Loic1
ServiceNow Employee
ServiceNow Employee

Changing the navigation URL on Employee Center

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.

find_real_file.png


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.

find_real_file.png

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).

find_real_file.png

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

find_real_file.png

 

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.

find_real_file.png

 

find_real_file.png

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.

find_real_file.png

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.

find_real_file.png

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}}"
}

find_real_file.png

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

find_real_file.png

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

Action label: KB Navigation
Action name: kb_navigation
Specify client action: kb_navigation

find_real_file.png

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.

find_real_file.png

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

find_real_file.png

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

find_real_file.png

Modify the value actionMappings in the Template field.

find_real_file.png

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

find_real_file.png

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.

find_real_file.png

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

find_real_file.png

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

find_real_file.png

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

find_real_file.png

find_real_file.png

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

References

find_real_file.png

Documentation

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!

Comments
Odin PL
Tera Explorer

Hi @Loic1, thanks for the explanation. Really helps with understanding EVAM and search result actions!

 

I have one question: After following your instructions the url still has additional parameters (e.g. "&sys_kb_id=xxx"), I'm having troubles getting rid of them.

 

I have gone in the AI Search Results Action Configurations table (sp_ai_search_results_action_config) and deactivated the records that contain those parameters in the payload query, but they persist. Is there another way these parameters could have been added that I overlooked?

Gerard Dwan
ServiceNow Employee
ServiceNow Employee

Hi @Odin PL ,

 

Generally speaking, when it comes to rendering or redirecting to KB content, you need the '&sys_kb_id=xxx'. 

 

Are there other url parameters you are looking to remove? Tables are always included in generated urls, for example. 

 

 

Community Alums
Not applicable

Hi Loic1,

Can we remove table from  generated URL?

 

Thanks,

Anu

Gerard Dwan
ServiceNow Employee
ServiceNow Employee

Hi anu21, 

 

It may be possible, but likely not worth it. You can manipulate the URLs using a Search Script Post Processor. There is not a way to withhold the information via Search Results Action configuraiton. 

Kristoffer Pari
Tera Expert

Hi @Loic1 and @Gerard Dwan, thank you for the great article. This is just what i'm trying to do. I have a record that can be searched in service portal. The record has a reference to catalog item. I'll then try to use that catalog item record in the action to direct the user to that catalog item when user click on the search result. But for some reason, i cannot get link to open with "id=sc_cat_item". It always opens in "id=form".

Also i cannot get any custom parameters added to the link.

 

I have set the Portal page of "sp_ai_search_results_action_config" to "sc_cat_item" and also done the "Action Payload Definition". The only thing that manage to change is the sys_id and table. Could you explain what determines what i can put in the "Action payload definition" ?

 

Thank you in advance,

Kristoffer

Gerard Dwan
ServiceNow Employee
ServiceNow Employee

Hi @Kristoffer Pari - this is an indication that you have a missing record in the 'Search Results Actions' table. The behavior you are describing is a fallback behavior. 

Hugo Tristant1
Tera Contributor

I can t read all in details but still interested in this area.

What is the added value of all of this?

Having the URL with a KB Number instead of a SysID ? Is that correct or something more beneficial behind ?

SusanWinKY
Kilo Sage

Is there a way to update the the URLs for search results in the Next Experience UI?

 

As an example, we get a genius result card for a knowledge article while searching in the Next Experience UI. The "View article" link opens to the article within the UI (kb_view.do). We would like to open that in the service portal instead. Similar for the "Request this item" button on catalog items. Is that possible?

 

As another example, we get a non-genius result card for a catalog item or order guide while searching in the Next Experience UI. Clicking the result card opens in the Next Experience UI (com.glideapp.servicecatalog_cat_item_view.do or com.glideapp.servicecatalog_cat_item_guide_view.do). We would also like to open that in the service portal instead. Similar for knowledge articles. Is that possible?

Christophe_E
Tera Contributor

Hello,

How to do the same for AI Search on Workspace ?

as search result action is specific to Portal.

Regards,

 

fauverism
Kilo Sage
Kilo Sage

Hi thanks for creating this and I'm just curious what is the benefit to the user by the URL referencing the sysparm_article URL parameter instead of the sys_id.? Totally fine if this is just a technical walkthrough. Just curious. 😊

Lynda1
Kilo Sage

In the Virtual Agent,  I have the link with this

/kb_view.do?sysparm_article=<KBnumber>

 

When I use the sys_id, there is the possibility that an article has been updated and I have noticed this approach opens an old version.  Using the sysparm_article.  It seems to always open the last published version.

sachin_namjoshi
Kilo Patron
Kilo Patron

 

fauverism use case is kb article sys_id will change if it's published multiple times. This will result in user seeing outdated version of KB articles. KB article number in url param will fix this use case.
Version history
Last update:
‎01-03-2023 04:58 AM
Updated by:
Contributors