How to populate the incident choice labels in virtual agent flow trough script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 01:31 AM
Hai All ,
I was facing an issue that , i have created a Virtual Agent flow Design to create the incident ,to populate the category i have written a script in the flow ,it was working fine ,but the back end "values" are population i want to populate the
"Label" values trough script ,i was new to virtual agent please correct me where i have did Rong ,
below is the script.
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).getValue()});
}
return options;
Present out put : what i was getting is the choice back end value , i want the label. to populate
please correct me .
To get the data i was written Script include to fetch the data from the data base,
script:
function VAChoiceListGenerator(table, field , depended){
var choices = new GlideChoiceListGenerator(table, field, depended);
return choices.get();
}
Please help me on this ,
Thank you,
Sekhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 04:58 AM
options.push({'value': choiceList.getChoice(i).getValue(), 'label': choiceList.getChoice(i).getValue()});
==> use choiceList.getChoice(i).getLabel()