Dynamic choice input in Virtual Agent
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi Everyone,
I am trying to build a Custom topic in virtual agent. I have a static choice and then based on the static choice there will be dynamic choice values. However I am not able to do so. Also I am not able to check logs as well for the script inside virtual agent
Script for dynamic choices:
function execute() {
gs.info('virtual agent script running');
var options = [];
var cat = vaInputs.category; // Category node ka variable name
// agar category nahi aayi
if (!cat) {
return options;
}
// lookup table se subcategory lao
var gr = new GlideRecord('u_hr_category_subcategory_lookup');
gr.addQuery('u_active', true);
gr.addQuery('u_category', cat);
gr.query();
gs.info("helloqwerty");
while (gr.next()) {
options.push({
value: gr.getValue('u_subcategory'),
label: gr.getValue('u_subcategory'),
render_style: 'data'
});
}
return options;
}
Can anyone please help me achieve this
Can anyone please help me achieve this
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @ShaidaC ,
Are the static category choice values same as u_category values in u_hr_category_subcategory_lookup?