How to Remove or Customize "Are you sure you want to end the conversation?" Pop-up in Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 12:35 AM
Hello colleagues,
I'm working on a customization for the Virtual Agent on the Service Portal, and I need your help.
When a user clicks the X button in the upper right corner of the Virtual Agent chat window, a confirmation pop-up appears with the message:
"Are you sure you want to end the current conversation?"
We would like to remove the pop-up, so that the chat simply closes without requiring confirmation.
I’ve checked the documentation and explored options such as:
- UI Messages
- System Properties
- Virtual Agent Widget configuration
However, I wasn’t able to find anything directly related to this specific pop-up.
I raised this with ServiceNow Support, and they confirmed that there’s no out-of-the-box setting to disable or configure this dialog and customization is required to change or remove the pop-up.
Has anyone implemented such a customization?
Any guidance or code snippets would be greatly appreciated!
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 12:43 AM
Hi @Violetta
I think you need to customize it...
Go to widget and clone the widget. And then try replacing the client script with the below code
$scope.confirmClose = function () {
$scope.closeChat();
};
Regards,
Prasanna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 12:43 AM
Search for virtual widget
Regards,
Prasanna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 12:48 AM
You can modify your existing script with below piece of code:
// Directly close the chat without confirmation
closeChatWindow(); // or whatever the internal method is
Instead of below:
if (confirm("Are you sure you want to end the current conversation?")) {
// close logic
}
✔️ If this solves your issue, please mark it as Correct.
✔️ If you found it helpful, please mark it as Helpful.
—
Shubham Jain