- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2023 06:19 AM
I am attempting to use the AI Search Topic Block inside another VA topic. I created a user input node for a user to enter a search string, and then immediately after inserted the AI Search topic block and am passing the user search term to the AI Search as the Search Term [input variables>search term]. When the search executes, it is correctly showing accurate results based on the user's search string, but for some reason it shows: "'Here's what I found for ""' [missing the user's search string].
For example if user enters "pay period", i would expect it to say "'Here's what I found for "pay period"', but instead it just shows "'Here's what I found for ""'.
Any ideas what I am missing here? I can't see where i might be missing passing the search term to the topic block... since it is set up in the input variables for the Search term, and it is correctly searching for the phrase...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2023 07:11 AM
You may want to check this part of the flow
For this script
This script is pulling vaSystem.getSearchText(), which pulls the user's utterance. This should instead be utilizing the input variable for the Topic Block. You should duplicate the Topic Block and rewrite it to look like this
(function execute() {
vaVars.shouldAskInfoHelpful = true;
var searchTerm = vaInputs.search_term;
return gs.getMessageLang('Here\'s what I found for "{0}"', vaContext.getRequesterLang(), [searchTerm]);
})()
By making this change, you can fix this issue!
Another place that you may need to modify is here, as when a Genius Result is displayed, the 'Show me more' option has a similar issue.
You will want to change this to read as below
(function execute() {
var options = [];
var searchTerm = vaInputs.search_term;
if (!gs.nil(vaVars.catalogId)) {
options.unshift({ 'value': 'request_catalog_item', 'label': gs.getMessageLang('Request Catalog Item', vaContext.getRequesterLang()), 'render_style': 'data'});
} else {
options.push({ 'value': 'yes', 'label': gs.getMessageLang('I\'m all set', vaContext.getRequesterLang()), 'render_style': 'data'});
}
options.push({ 'value': 'no', 'label': gs.getMessageLang('Show me more on "{0}"', vaContext.getRequesterLang(), [searchTerm]), 'render_style': 'data'});
if (vaInputs.ask_another_search == 'true') {
options.push({ 'value': 'another_search', 'label': gs.getMessageLang('Ask something else', vaContext.getRequesterLang()), 'render_style': 'data'});
}
return options;
})()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2023 06:30 AM
Good morning!
Which release is this occurring in?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2023 06:36 AM
Hi! This is San Diego patch 10 hotfix 1A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2023 07:11 AM
You may want to check this part of the flow
For this script
This script is pulling vaSystem.getSearchText(), which pulls the user's utterance. This should instead be utilizing the input variable for the Topic Block. You should duplicate the Topic Block and rewrite it to look like this
(function execute() {
vaVars.shouldAskInfoHelpful = true;
var searchTerm = vaInputs.search_term;
return gs.getMessageLang('Here\'s what I found for "{0}"', vaContext.getRequesterLang(), [searchTerm]);
})()
By making this change, you can fix this issue!
Another place that you may need to modify is here, as when a Genius Result is displayed, the 'Show me more' option has a similar issue.
You will want to change this to read as below
(function execute() {
var options = [];
var searchTerm = vaInputs.search_term;
if (!gs.nil(vaVars.catalogId)) {
options.unshift({ 'value': 'request_catalog_item', 'label': gs.getMessageLang('Request Catalog Item', vaContext.getRequesterLang()), 'render_style': 'data'});
} else {
options.push({ 'value': 'yes', 'label': gs.getMessageLang('I\'m all set', vaContext.getRequesterLang()), 'render_style': 'data'});
}
options.push({ 'value': 'no', 'label': gs.getMessageLang('Show me more on "{0}"', vaContext.getRequesterLang(), [searchTerm]), 'render_style': 'data'});
if (vaInputs.ask_another_search == 'true') {
options.push({ 'value': 'another_search', 'label': gs.getMessageLang('Ask something else', vaContext.getRequesterLang()), 'render_style': 'data'});
}
return options;
})()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2023 07:34 AM
Thank you Will! this worked.