Add new fields in Related Search field in Incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi, I had a requirement to add Service Region and Domain fields which I have created in Knowledge table to be visible in the Incident form Related Search field. Currently the Related Search field in the incident form displays the KB Short Description, Athor, Rating, Last Modified and Views. In addition to this I wanted these two new fields also to be visible. Could someone help how I can add these fields in this. I tried all the ways, But I couldn't find a proper solution yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @mariyajohny
"Regenerate Text Indexes" using related link as per this KB:
KB2788936 Related Search Results not working on Incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
If you mean the Contextual Search results on the Create Incident form in Service Portal, those results are produced by a widget. The out-of-box widget shows knowledge articles as users enter text, and ServiceNow’s documented approach is to clone the widget and customize the clone when you need different behavior
A practical way to approach it:
- Confirm the page is using the Contextual Search widget, rather than a classic form related list or another search component.
- In Service Portal > Service Portal Configuration Widget Editor, find the Contextual Search widget and clone it. Don’t modify the base widget directly.
- In the cloned widget, inspect the server script and the template that builds each knowledge-result card. Add your custom Knowledge fields—Service Region and Domain—to the result data, then render them in the template.
- Make sure the fields are present on the kb_knowledge records and readable by the users who see the results. If either field is a reference field, decide whether to display its label or another value.
- Update the Create Incident page or widget instance to use your clone, then test with articles where both fields have values and where they are blank.
The exact code depends on the widget version and how its search results are retrieved, so check the cloned widget’s existing result structure before adding GlideRecord queries. Avoid changing the out-of-box widget or its underlying search behavior unnecessarily.
If you meant a different “Related Search” component, the steps may differ—identify the widget or UI component on the Incident page first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @rajihuj ,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Tanushree Maiti ,
Thank you for the suggestion. I tested reindexing the Knowledge source and regenerating the text index. The KB articles are already appearing correctly in Related Search Results, and the reindexing did not make the custom fields (Service Region and Domain) visible.
My requirement is not related to missing KB articles in Related Search. Instead, I need to display additional Knowledge Article fields in the Related Search result card on the Incident form.
During my investigation, I found that the search result card is rendered by the OOTB read-only UI Macro: cxs_result_kb_knowledge.
The macro currently displays metadata such as:
- Author
- Rating
- Last Modified
- Views
I have also tested adding the custom fields to the search index and reindexing the Knowledge source, but the fields are still not displayed in Related Search Results.
Could you please advise whether there is a supported way to extend the OOTB cxs_result_kb_knowledge renderer (or an alternative configuration/extension point) to display additional custom Knowledge fields such as Service Region (u_region) and Domain (u_kb_domain) in the Incident Related Search results?
Thanks in advance.