Ratnakar7
Mega Sage
Mega Sage

Problem Statement

When users input a query into the Virtual Agent Chatbot that doesn't match any intent for configured topics, the fallback mechanism only displays a limited number of search results. Currently, only 3 results are shown from AI Search fallback and another 3 from Contextual Search fallback. This forces users to click "Show more" or "I need more help" to see additional results, which can be inefficient and frustrating.

- AI Search Fallback showing only 3 results              - Contextual Search fallback showing only 3 results

Ratnakar7_11-1716200133672.pngRatnakar7_12-1716200201463.png

 

Expected Output

The goal is to provide users with a maximum number of relevant content options upfront, reducing the need to navigate to additional pages by clicking "Show more." By increasing the number of results displayed in both AI Search and Contextual Search fallback topics, users will have a more streamlined and efficient experience.

Solution

To achieve this, configure the fallback setup topics and update the respective system properties to display up to 10 results from each fallback topic.

Step-by-Step Guide

Step 1: Configure Fallback Setup Topics

     1.1 AI Search Fallback:
  • Navigate to Conversational Interfaces:

    • Go to Conversational Interfaces -> Settings.
  • Update AI Search Fallback Setup Topic:

    • Navigate to Virtual Agent -> Custom Greetings & Setup -> Default chat experience.
    • Select AI Search fallback.
    • In the 'Setup topic' drop-down, choose the "AI Search - Fallback" topic.
    • Click the "Save" button.

                Ratnakar7_0-1716197545244.png

  

     1.2 Contextual Search Fallback
Step 1: Duplicate "Contextual Search" Topic Block
  • Navigate to Virtual Agent Designer:
    • Go to Virtual Agent -> Designer and search for "Contextual Search".
  • Duplicate the Topic Block:
    • Click on Duplicate
      Ratnakar7_3-1716198157197.png
    • Set the Duplicate topic name as "Contextual Search-custom".
  • Update the "limit" Script Variable:
    • Update the limit script variable value to match the system property value.
      [gs.getProperty('com.glide.cs.max_grouped_parts');]
      Ratnakar7_4-1716198775628.png
    • Save and Publish the "Contextual Search-custom" topic block.
Step 2: Duplicate "Search Fallback Topic" and Update
  • Duplicate the "Search Fallback Topic":
    • Go to Virtual Agent -> Designer and search for "Search Fallback Topic".
    • Click on Duplicate
      Ratnakar7_2-1716197974826.png
    • Set the Duplicate topic name as "Search Fallback_custom".
  • Copy the values from the Topic Block:
    • Make a note of the "context (String)" and "query (String)" values. 
      Ratnakar7_5-1716199115508.png

       

  • Replace Topic Block:
    • Replace the topic block from "Contextual Search" to "Contextual Search-custom".
    • Configure the previously noted values in the context and query string parameters.
      Ratnakar7_6-1716199329837.png

       

    • Save and Publish the "Search Fallback_custom" Topic.
Step 3: Update Contextual Search Fallback Topic to Custom Topic
  1. Navigate to Conversational Interfaces:

    • Go to Conversational Interfaces -> Settings.
  2. Update Fallback Setup Topic:

    • Navigate to Virtual Agent -> Custom Greetings & Setup -> Default chat experience.
    • Select Fallback.
    • In the 'Setup topic' drop-down, choose "Search Fallback_custom".
    • Click the "Save" button.

Step 2: Update System Properties for Max Results

     2.1 AI Search
  • Navigate to System Properties:

    • Go to https://_Your_INSTANCE_.service-now.com/sys_properties_list.do.
  • Update AI Search Max Results Property:

    • Search for the property "com.glide.cs.ai_search.max_regular_result".
    • Set the value upto 10.
    • Save the changes.
      Ratnakar7_7-1716199581121.png

       

     2.2 Contextual Search
  • Navigate to System Properties:

    • Go to https://_Your_INSTANCE_.service-now.com/sys_properties_list.do.
  • Update Contextual Search Max Results Property:

    • Search for the property "com.glide.cs.max_grouped_parts".
    • Set the value upto 10.
    • Save the changes.
      Ratnakar7_8-1716199688861.png

Expected Output

After implementing these changes, the Virtual Agent should display up to 10 results for both AI Search and Contextual Search fallback topics, providing users with more relevant content upfront and reducing the need for additional navigation.


- AI Search Fallback showing 8 result per page        - Contextual Search Fallback showing 8 result per page

Ratnakar7_10-1716199941205.pngRatnakar7_9-1716199814524.png

 

Conclusion

By configuring the fallback setup topics and updating the system properties to increase the number of results displayed, you can enhance the user experience in ServiceNow Virtual Agent. Users will have access to more relevant content immediately, improving efficiency and satisfaction.

Implementing these changes ensures that users spend less time navigating through multiple pages and more time finding the information they need. This streamlined approach is essential for maintaining an effective and user-friendly chatbot experience.

Relevant KBs:
Comments
goldenjc97
Tera Contributor

@Ratnakar7 - Nice work - Worked perfectly for me.

Alayna S_
Tera Explorer

This worked really well for me, thank you! Is there a similar option for the maximum search results? So instead of 20 results I only want 10 returned.

goldenjc97
Tera Contributor

@Alayna S_ I set mine to 10.... Set the sys property to 10 and set your max_search_result_count variable in Contextual Search topic block to also be 10. You will now get 2 batches of 5 results. 

 

The only thing that I had issues with was the text saying 2 of 10, so I modified the header message in 'Display Multi-Link' step to just be something static/basic -- "See below search results:",

Alayna S_
Tera Explorer

@goldenjc97 Yes thats exactly what I am doing! 2 batches of 5 for max of 10 results and that did fix it to only return max 10 results

 

I set both properties in the above instructional post to 5 and then set the max_search_result_count variable to 10 and I am getting the correct text header on the results. "Showing results 1 to 5 of 10" & "Showing results 6 to 10 of 10"

 

Thank you!

Version history
Last update:
‎05-20-2024 04:54 AM
Updated by:
Contributors