Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to show choice table choice in virtual agent

AnilM99
Tera Expert

Hi Team,

Present i am using below code to display Choice table categories, the below code is working fine to show all categories 

Dynamic choice input Script:

(function execute() {
var choiceList = global.VAChoiceListGenerator('incident', 'category');
 
var options = [];
for (var i=0; i < choiceList.getSize(); i++){
options.push({ 'value': choiceList.getChoice(i).getValue(), 'label': choiceList.getChoice(i).getLabel() });
}
return options;
})()
Script include:
function VAChoiceListGenerator(table, field, dependend){
    var choices = new GlideChoiceListGenerator(table, field, dependend);  
    return choices.get();   
}
 
We have another field, "category automation (true or false)," in the choice table. 
My requirement is 
Show categories if category automation is true.
0 REPLIES 0