Virtual Agent -- Needs to add one more option

Ramesh43
Tera Contributor

Hello Everyone, Good Morning!!

 

I have a requierment like, need to one more option called "Show Me Everything"  under the section.

In highligted area i want to add the above mentioned option.

Ramesh43_0-1753937952616.png

The below is the script for the same:

(function execute() {

var resultMap = global.VAAISearchHelperVancouver.createResultMap(vaVars.searchMetadata, vaVars.searchResults, vaSystem, vaInputs, vaVars, vaContext);
 
// Set false to avoid duplications. Once sent, this flag prevents the same payload from being sent again
vaVars.sendDisplayedSearchResultClickMetricsEvent = false;

var options = [];
for (var key in resultMap) {
options.push({ 'value': key, 'label': resultMap[key], 'render_style': 'data'});
}
options.push({ 'value': 'no', 'label': gs.getMessageLang('I need more help...', vaContext.getRequesterLang()), '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'});
 
}
options.push({ 'value': 'show_all', 'label': 'Show me everything' });
return options;
})();

Can someone please help me to acheive this.
1 REPLY 1

GlideFather
Tera Patron

Hi @Ramesh43 try to replicate it for different scenarios, I do't think this is limited by a number. It would be similar like searching in the KB - for one input you get 4 returned articles, for another input you get 8 and for another you get zero...

 

Either test this step for different intent or create more KBs that would match this criteria and next time it shall display more. Eventually different people from user criteria perspective.

 

Keep me updated

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */