Dynamic Choice Input In VA.

pandeyved
Tera Contributor

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:

(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(hardwareContent.catalog_item.getDisplayValue());
}
return options;
})()
But My chat bot returning I have technical Issue. Kindly Guide

Thanks
Vedant

6 REPLIES 6

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

You already posted twice before on this topic, I also responded, though you are not responding back... Why now posting a third time?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Mark Roethof
Tera Patron
Tera Patron

Also see my reply in the earlier post you already made on this topic.

 

"Are you using a Dynamic Choice user input? If so, the expected format is a value + label. Also see the example code in the Dynamic Choice script."

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn