Anything else topic triggering after live chat conversation is closed

Yasmin
Kilo Guru

Hello, We are Implementing VA in Paris and AWA for live chat. Users are connecting to live chat thru the virtual agent UI. We noticed that the Anything Else topic is triggered after the live chat conversation is ended by the live agent. And if the user clicks "No", for there's nothing else s/he needs help with, then the live chat survey is displayed within the VA UI. 

Is there a way to not trigger the Anything Else topic after a live chat session ends, and instead trigger the live chat survey?
This way we won't miss users from taking the live chat survey or confuse the Anything else topic thinking they are still chatting with the live agent.

find_real_file.png

Thank you.

1 ACCEPTED SOLUTION

Hi Yasmin,

Maybe you could try the following:

1. Create a context variable going to Collaboration > Chat Setup

find_real_file.png

2. Add this new variable to your Transfer Live Agent Topic Properties, under Live Agent Variables:

find_real_file.png

3. In your "End conversation Script", after you close the conversation, set this new variable to true:

(function execute() {

    vaSystem.endConversation();
    vaVars.LiveAgent_Close_Conversation = true;

})()

4. Create A Custom Anything else topic.

4.1. Add the LiveAgent_Close_Coversation variable to its Live Agent variables:

find_real_file.png

 

4.2 Add a Condition at the start of the flow that checks if the Live_Agent_Close_Conversation is true:

find_real_file.png

The condition script would look like this:

(function execute() {
   if(vaVars.LiveAgent_Close_Conversation == true){
       return true
      }
})()

4.3 Add a Script Action that resets the Live_Agent_Close_Conversation before ending the worfklow. This way the Anything else topic can be triggered for other topics:

(function execute() {
 vaVars.LiveAgent_Close_Conversation = "";
})()

5. Go to Collaboration > Virtual Agent > General Settings and set this new topic as your Anything else topic.

View solution in original post

10 REPLIES 10

Thank you Mark, test and share any findings. 

So just did 3 small tests.

- 1 with a Script Action, with code:

(function execute() {

    vaSystem.endConversation();

})()

- 2 with a Topic block which contains this code.

- 3 switching (topicDiscovery and topicSwitch) to the Closing conversation.

2 and 3 don't work... after finishing the topic block / the topic switched to, the anything else / survey are triggered.

1 though... having this code directly in your topic... works! The chat is ended immediately.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

So, I tested creating a regulat topic that transfers to live chat and then ends the conversation using the vaSystem.endConversation() function, but still getting the anything else AND/OR VA feedback topic. Sometimes I get the anything else, sometimes I get the VA feedback topic. In any case it is as if it skips the end conversation function.

find_real_file.png

The functions within each node are as follows:

Connect to live chat:
(function execute() {
vaSystem.connectToAgent();
})()
 
End conversation msg:
(function execute() {
return vaSystem.getClosingMessage();
})()
 
End conversation:
(function execute() {
vaSystem.endConversation();
})()

 

Not sure why it's still triggering the anything else and/or feedback topic.

Yasmin
Kilo Guru

I'm thinking that the solution here would be to add a validation within the VA feedback topic to check if user had a live chat session in the past hour or so. And if so, do NOT trigger the VA feedback topic. Has anyone tried doing such validation? Any ideas on scipts for that?

Thanks.

Hi Yasmin,

Maybe you could try the following:

1. Create a context variable going to Collaboration > Chat Setup

find_real_file.png

2. Add this new variable to your Transfer Live Agent Topic Properties, under Live Agent Variables:

find_real_file.png

3. In your "End conversation Script", after you close the conversation, set this new variable to true:

(function execute() {

    vaSystem.endConversation();
    vaVars.LiveAgent_Close_Conversation = true;

})()

4. Create A Custom Anything else topic.

4.1. Add the LiveAgent_Close_Coversation variable to its Live Agent variables:

find_real_file.png

 

4.2 Add a Condition at the start of the flow that checks if the Live_Agent_Close_Conversation is true:

find_real_file.png

The condition script would look like this:

(function execute() {
   if(vaVars.LiveAgent_Close_Conversation == true){
       return true
      }
})()

4.3 Add a Script Action that resets the Live_Agent_Close_Conversation before ending the worfklow. This way the Anything else topic can be triggered for other topics:

(function execute() {
 vaVars.LiveAgent_Close_Conversation = "";
})()

5. Go to Collaboration > Virtual Agent > General Settings and set this new topic as your Anything else topic.