Employee Center search exact match results in form view

zynsn
Tera Expert

Hi ServiceNow,

 

When we search in employee center for a req # or ritm # and it returns a result for an exact match, that result brings us to the form view instead of the EC pages of request or RITM. How do we configure the exact match result to take us to the Employee Center page version instead of the form view?

 

Thanks.

zynsn_0-1695049018462.pngzynsn_1-1695049021559.png

 

 

3 REPLIES 3

Dan O Connor
ServiceNow Employee
ServiceNow Employee

Hi @zynsn this was a known issue in Employee Center that I believe did get a fix on a previous release but still crops up every now and then. 

 

There are some workarounds I have used to resolve this issue and others like it, but I would first recommend that you raise this through HI Support. While support will assist you in resolving the issue, it can also possibly make its way to the Product team who can see if this is something that needs to be fixed in a future release (or if its an issue that was just affecting your instance) 

 

https://support.servicenow.com/now

Hi,

 

I opened a ticket in HI few weeks ago, the reply i got from support is that exact match search is not yet supported in service portal and offered a way to disable it.

They did not provided a way to change the form the user land.

 

were you able to find a way to control it?

@zynsn@Dan O Connor , @Eli Guttman ,

I was able to fix it with configurations and disabling Exact match search.
Please find my approach below.

STEP 1:
If AI Search is enabled on your ESC portal, below steps can be taken to open search results in the portal. [Create an update set in "Employee center core" application to capture these]
Check if "Indexed Sources" module under "AI Search" has required record for table in question "sc_req_item" (for example).
OOB there is one source for "sc_req_item", leave it as is.
In your case if it is not available, create a new Indexed source for your table probably in Global scope (in most cases) in another set depending on the application you are dealing with.
Make sure to use "Index Selected" table so that system indexes relevant records. Doing it once is fine.

STEP 2:
Now go to "Search Profiles" module under "AI Search" left nav menu. Search and open "ESC Portal Default Search Profile". [This is the search profile linked to your Employee center portal OOB.]
Under "Search Sources" related list tab, by default you have "ESC Portal Knowledge Bases", "ESC Portal Catalogs" (if OOB configurations are not changed). If you do not have anything else, you need to use "Create and Link" button on search sources tab. If you are planning to reuse existing sources, use "Link Existing".
In my case, I created a search source with name "ESC RITM Records" with condition "Opened by - is(dynamic) - Me [OR] Requested for - is(dynamic) - Me".
Note that in the "Indexed Source" field, you need to pick the source, you identified in step 1 or created in Step 1, if OOB one is not available.
As soon as you do this, system will create a new navigation tab to display Requested Items search results in separate tab in service portal. This is done automatically.
[In my case, I created the sources for REQs, RITMs, INCs. Here I am only explaining RITMS. Remaining you can take care from your side. But I do not want to display REQs in separate in esc portal search results page. For this you need to go to "Portals" left navigation menu -> Open "Employee center" portal record -> Scroll down to the form, open search application in new tab and turn the REQs related tab active=false in "Navigation tabs" related list. (You cannot delete the tab, you can only make it false, or adjust ordering of tab]

STEP 3:
Now we need to think about these. After I enter a term, system will show the results as type ahead suggestions or exact match suggestions.
Exact match may show unintended results, so it is better to turn it off. [If your environment does not have strict ACLs or data filtration rules, a portal user may check records they were not supposed to see if they get the record number somewhere. It would be a separate story to consider and is Out of scope of this answer.]
Go to "Portals" left navigation menu -> Open "Employee center" portal record -> Scroll down to the form, open search application in new tab. [Notice that this record also displays a blue info message about exact match search on top.]
Uncheck "Enable Exact Match" and save it.

STEP 4:
On portal after you enter search term, the suggestions will pop up as type ahead suggestions, and also if you do not wait for type ahead to click on suggestions, system will search on its side and also takes you to a page where it shows search results in multiple tabs like "All, Requests, Articles, ...". All, Requests, Articles are OOB. Any new search source you configure, they will show up as new tab here. If you don't want special tab for it, you can disable it as I explained at the end of STEP 2.
Here you need to make sure that results display intended cards with fields info of each matching record to give more context rather than just number. And each result displayed should be clickable and when clicked it should land in esc portal. For this follow next steps.

STEP 5:
Go to "Evam definitions" module under left navigation menu. Look for "ESC portal search" as we are configuring search results view in ESC portal. [Reason for this is "ESC portal search" is used in the "Search Results Configuration" field or your portal record for ESC portal found in "Portals" left nav menu. ServiceNow uses the "Evam definitions" of "ESC portal search" to show the results. If nothing is defined here, no results show up in portal even if servicenow finds results for search you perform.]
In the "EVAM View Config Bundle M2Ms" tab, click on "ESC Portal Search Bundle"
In the subsequent page, on the "EVAM view Configs" related list, click on "New"
Give "Name" field as "RITM Search Results Config" or as per your wish or relevance.
"Table" field as "sc_req_item".
"Table Fields" list fill it with "Item.Name, Number, Short description, State, Requested for.Name, Opened by.Name, Opened"
"Custom Fields" fill it with "ai_search_teaser_title,ai_search_teaser_text,document_index,child_docs" without quotes. [Some of these may not be required, but it is Out of scope of this answer to explain]
"View Template" leave it empty we will create it in next steps and update it in this field later.
Save the form. [Do not submit as we need to update related list.]

In the "EVAM View Config Action Assignment M2Ms" related list, use link existing and add "navigation" declarative action.

After these updates even if you go to portal, for searches you will not find search results card although it shows count of records found. View template is required to show the results. Without view template, results won't be shown.

STEP 6:
Go to "View Templates" module under "Entity view action mapper (EVAM)" application in left nav.
Create a new record with
Name as "ESC RITMs search result cards config"
In the template field, fill below.

 

{
  "component": "sn-search-result-evam-card",
  "staticValues": {
    "imageType": {
      "translatable": false,
      "key": "icon"
    },
    "icon": {
      "translatable": false,
      "key": "bundle-outline"
    },
    "textHeaderLabelOne": {
      "translatable": true,
      "key": "Requested Item"
    },
    "detailLabelOne": {
      "translatable": true,
      "key": "State:"
    },
    "detailLabelTwo": {
      "translatable": true,
      "key": "Requested For:"
    },
    "detailLabelThree": {
      "translatable": true,
      "key": "Opened By:"
    },
    "detailLabelFour": {
      "translatable": true,
      "key": "Opened:"
    },
    "detailLabelSeparator": {
      "translatable": false,
      "key": "|"
    },
    "detailPosition": {
      "translatable": false,
      "key": "above"
    },
    "requireLabelAndValue": {
      "translatable": false,
      "key": "true"
    }
  },
  "mappings": {
    "textHeaderLabelTwo": "number",
    "detailValueOne": "state",
    "detailValueTwo": "requested_for.name",
    "detailValueThree": "opened_by.name",
    "detailValueFour": "opened_at",
    "title": "cat_item.name",
    "attachments": "child_docs"
  },
  "actionMappings": {
    "clickAction": "navigation"
  }
}

 

set it to active and save.

Now go to the "RITM Search Results Config" EVAM view config record created in STEP 5 above and save the "View Template" field to "ESC RITMs search result cards config".


STEP 7:
Go to "Search Results Actions" module under "Service Portal" left navigation menu, create new record with below details.
Name: RITM View Record
Service Portals: Employee Center
AI Search Source: ESC RITM Records
Action name: navigation
Portal page: ticket [In ESC portal if you customized ticket display page and showing tickets in different page, you need to give relevant page here. In most cases - for RITM or INCs 'ticket' is used, for REQ order_status is used. If you have a different set up, you may choose to select appropriate page.]
Active: checked

Save the record.

STEP 8:
Publish "ESC Portal Default Search Profile" mentioned in step 2.


Final Note:
If you are configuring sc_request search or incident search or any other type of records search in portal, you need to follow similar steps (1 through 7).
Also, if you have multiple portals, you may reuse some of these configs, so you may name relevantly.

FYI. Below are examples for EVAM view configs.

For incidents EVAM view config fields for example may be filled as:

Table Fields: Number, Short description, State, Caller.Name, Opened, Priority 
Custom Fields: ai_search_teaser_title,ai_search_teaser_text,navigation_url,document_index,child_docs
In the view template record that you would be creating and mapping fill JSON as

 

{
  "component": "sn-search-result-evam-card",
  "staticValues": {
    "imageType": {
      "translatable": false,
      "key": "icon"
    },
    "icon": {
      "translatable": false,
      "key": "circle-exclamation-outline"
    },
    "textHeaderLabelOne": {
      "translatable": true,
      "key": "Incident"
    },
    "detailLabelOne": {
      "translatable": true,
      "key": "State:"
    },
    "detailLabelTwo": {
      "translatable": true,
      "key": "Opened:"
    },
    "detailLabelThree": {
      "translatable": true,
      "key": "Caller:"
    },
    "detailLabelFour": {
      "translatable": true,
      "key": "Priority:"
    },
    "detailLabelSeparator": {
      "translatable": false,
      "key": "|"
    },
    "detailPosition": {
      "translatable": false,
      "key": "above"
    },
    "requireLabelAndValue": {
      "translatable": false,
      "key": "true"
    }
  },
  "mappings": {
    "textHeaderLabelTwo": "number",
    "detailValueOne": "state",
    "detailValueTwo": "opened_at",
    "detailValueThree": "caller_id.name",
    "detailValueFour": "priority",
    "title": "ai_search_teaser_title",
    "attachments": "child_docs"
  },
  "actionMappings": {
    "clickAction": "navigation"
  }
}

 

 

For SC_REQUEST EVAM view config fields for example may be filled as:

Table Fields: Number, State, Requested for.Name, Opened by.Name, Opened 
Custom Fields: ai_search_teaser_title,ai_search_teaser_text,navigation_url,document_index,child_docs
In the view template record that you would be creating and mapping fill JSON as

 

{
  "component": "sn-search-result-evam-card",
  "staticValues": {
    "imageType": {
      "translatable": false,
      "key": "icon"
    },
    "icon": {
      "translatable": false,
      "key": "square-question-outline"
    },
    "textHeaderLabelOne": {
      "translatable": true,
      "key": "Request"
    },
    "detailLabelOne": {
      "translatable": true,
      "key": "State:"
    },
    "detailLabelTwo": {
      "translatable": true,
      "key": "Requested For:"
    },
    "detailLabelThree": {
      "translatable": true,
      "key": "Opened By:"
    },
    "detailLabelFour": {
      "translatable": true,
      "key": "Opened:"
    },
    "detailLabelSeparator": {
      "translatable": false,
      "key": "|"
    },
    "detailPosition": {
      "translatable": false,
      "key": "above"
    },
    "requireLabelAndValue": {
      "translatable": false,
      "key": "true"
    }
  },
  "mappings": {
    "textHeaderLabelTwo": "number",
    "detailValueOne": "state",
    "detailValueTwo": "requested_for.name",
    "detailValueThree": "opened_by.name",
    "detailValueFour": "opened_at",
    "title": "ai_search_teaser_title",
    "summary": "ai_search_teaser_text",
    "attachments": "child_docs"
  },
  "actionMappings": {
    "clickAction": "navigation"
  }
}

 


Please mark my reply as answer and helpful if it fixed the issue you are facing.