Knowledge Article Body not showing in Search Context
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 09:23 PM
I have a custom-scoped ServiceNow application that inherits the global incident table and knowledge article table (kb_knowledge). This is done so that the instance can work as a shared instance with different departments and each department has it's own scoped application inheriting the incident and knowledge table, keeping each incident and knowledge management system private.
I created a search context that allows our department's users to search our scoped knowledge table articles on our scoped incident table's forms. The search context for knowledge articles usually shows the knowledge article body as the short description, and it does for the regular knowledge articles. However, for the knowledge articles created in the custom-scoped knowledge table, the search results shown in the search contexts show "No description" instead of showing the article body as it usually does.
Can someone please help me on how this can be fixed? Thank you in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 09:45 PM
The Search Context widget typically uses the `short_description` or a defined `display field` for the preview in the results. When it doesn't find an expected field (like `text`, `article_body`, or a configured preview field), it defaults to “No description”.
Since you're working with custom tables in a scoped app, there are two most likely causes:
1. Your Scoped Knowledge Table Doesn't Have a Field Search Context Expects
Even though your custom table extends `kb_knowledge`, some things might not carry over as expected in scoped apps.
Search Context typically expects:
`short_description`
`text` or `article_body`
`display` or summary field in the GlideRecord
Check:
Does your scoped `kb_knowledge` table still use the `text` field from the global table?
Go to Tables > [your scoped KB table]
Open the table, check if `text` or `article_body` exists and is populated.
Fix 1: Add or Reuse the Expected Body Field
If `text` or `article_body` isn't present in your scoped knowledge table:
Option A: Create a new field called `text` and populate it with the article content.
Option B: Use a Business Rule to copy your custom body field into `text` for indexing/search purposes.
Example Business Rule:
// Run on Insert or Update
if (current.custom_article_body_field.changes()) {
current.text = current.custom_article_body_field;
}
2. The Search Source Is Not Configured to Use the Right Field
Check your Search Source (used by the Search Context):
Go to: Content Management > Search Contexts
Find the context used in your scoped incident form
Click into the Search Source tied to your scoped knowledge table
Look at the Display Field, Title Field, and Summary Field
Fix 2: Set the Summary Field to the Correct Body Field
Make sure the Summary Field is pointing to your scoped article body field (or `text`, if it exists).
Use a Scripted Search Source (If Needed)
If you need more flexibility, you can build a Scripted Search Source that explicitly controls how search results are built for your scoped KB table.
You can do something like:
(function searchSource(request, response) {
var gr = new GlideRecord('x_your_scope_kb_knowledge');
gr.addQuery('published', true); // or any conditions you want
gr.query();
while (gr.next()) {
response.addResult({
id: gr.sys_id.toString(),
title: gr.short_description,
summary: gr.custom_article_body_field.getDisplayValue(),
url: '/kb_view.do?sys_kb_id=' + gr.sys_id
});
}
})(request, response);
Quick Checklist to Fix the "No description" Issue
Make sure your scoped table has a field called `text` or a valid equivalent with article content. Ensure that field is populated (via user input or a Business Rule). In the Search Source, set the Summary Field to that article body field. (Optional) Use a scripted search source if you need full control.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 12:54 AM
@SasiChanthati ,
Thank you for the response. The field is there in the custom table and it's display is active. There is no way to see which field is linked in the Search contexts as you have mentioned. There is no such thing as a Search Source, there's only "Searcher" field. The searchers can't be modified nor do they show the mapping. Can you please more details on this Search Source that you've mentioned?