Dynamic Choice Input In VA.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 03:08 AM
Hi all,
I need help in one use case. In Virtual agent we need to provide user a option to select which will come dynamically from the table.
Detail:
We are showing some topics from Employee Center in our Virtual Agent and As We have connected content for the topics, so we need to display all the connected content from the topics which is available in portal. But instead of statically defining the catalogs mapped to the particular topic we need to show directly from the table. How can we achieve this?
I am writing this code in VA Script in Dynamic choice Input:
Thanks
Vedant

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 03:56 AM
Hi @pandeyved
Considering your encoded query is correct, you need to change the script like below:
(function execute() {
var options = [];
var hardwareContent = new GlideRecord("m2m_connected_content");
hardwareContent.addEncodedQuery("topic.parent_topic=891e85b01b5ab550134bddf59b4bcb9b^catalog_item!=NULL");
hardwareContent.query();
while(hardwareContent.next())
{
options.push({ 'value': hardwareContent.catalog_item.getUniqueValue(), 'label': hardwareContent.getDisplayValue('catalog_item') });
}
return options;
})()
test your topic and let us know what error you are getting
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 03:58 AM
Check below link for more details.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2024 08:53 PM
Hi @Anil Lande
Thanks for the help, but After using this still I am getting this error:
Can you please support

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2024 09:59 PM
So what is the logs telling you? Usually when getting this message, most of the times valuable information is written to the logs.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field