The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Virtual Agent Survey Modification for Topic

295victor
Tera Contributor

Hello,

I’m currently working on customizing the default Virtual Agent feedback topic. Specifically, I’d like to implement a condition that restricts to trigger when the user interacts with the “Create Incident” topic. For all other topics, the feedback should continue to function as usual.

Could you please advise on how this can be achieved within the Virtual Agent Designer or through configuration?

2 REPLIES 2

G Ponsekar
Giga Guru

Hi @295victor ,

 

To restrict the default Virtual Agent feedback topic from triggering after the "Create Incident" topic, you must customize the feedback topic and use a special context variable. The key is to check the previous topic that the user interacted with before the feedback was offered.

 

ServiceNow Virtual Agent passes context variables throughout a conversation. You will use the vaContext.last_topic_id variable, which stores the ID of the last topic run in the conversation.
Find the sys_id of the Create Incident topic.
Modify the Virtual Agent Feedback topic.
Add a Decision node at the beginning of the feedback topic flow.
Use a script to check if the last topic's sys_id matches the Create Incident topic's sys_id.
If there is a match, end the conversation; otherwise, continue with the standard feedback flow.

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks, GP

Hi @G Ponsekar ,

Thanks for the solution i tried it, but it did not work.

As per your guidance i have tried the code as below

---------------------------------------------------------------------------------------------------------------------------------

as251804_1-1756905494028.png

 

Script node :-
(
function execute() {
 
var createIncidentSysId = '( Topic sys_id here placed here)'
var lastTopicId = vaContext.last_topic_id;

if (lastTopicId === createIncidentSysId) {
vaVars.feedbackAllowed = false;
} else {
vaVars.feedbackAllowed = true;
}})()
 
branch Matched code:-

(function execute() {
if(vaVars.feedbackAllowed == false)
{
return true;
}
})()
 
branch Unmatched code
(function execute() {
if(!vaVars.feedbackAllowed == false)
{
return true;
}
})()