Anurag Tripathi
Mega Patron
Mega Patron

Recently came across this interesting challenge and I couldn’t find a solution as quickly as I would have liked. So thought to put it in this blog for anyone else looking for the same.

 

This blog will help overcome the following issues

  • Load Virtual agent on multiple windows and continue on same chat.
  • Chat ends if virtual agent page is refreshed
  • Hide chat history.

Issue: When Virtual agent chat page is refreshed/duplicated it initiates new chat again with support agent.

 

This ServiceNow KB article HERE explains the issue and how it can be resolved by removing 'sysparm_skip_load_history=true' on the virtual agent widget, but what if you don’t want to show users the chat history?

 

On the Virtual agent widget we have the below ways to control this behavior

  • Default Behavior-> Chat history loads and as the user can keep scrolling up to see historical chat. They can see chat history going back upto 1 month.
  • If you don’t want to include the history add 'sysparm_skip_load_history=true' parameter to the chat widget as shown below. The downside of this approach is if the chat page is refreshed or duplicated then it ends the existing chat (current chat) and creates a new one each time, which is not a good experience.

 

Recommended Solution:

Add 'sysparm_load_active_only=true' parameter when you remove 'sysparm_skip_load_history=true'. This will not load any history but show the active chat(if any) and all the conversation for the active chat and also ensure that no new chats are created if the page is refreshed or duplicated.