- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2020 01:48 PM
I want to restrict the chat history shown on the bot to 2 days instead of the whole history. How to do this?
Solved! Go to Solution.
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2020 12:05 AM
Hi there,
Out-of-the-box, you only can completely disable the history, or show all.
It depends on how you added you Virtual Agent widget to your Service Portal. Through older methods like (1) dragging/dropping the widget onto a SP page, (2) embedding it to the header footer. Or (3) using the current preferred ServiceNow method of applying Agent Chat configuration.
NO need to clone and edit the widget.
The widget has a instance option "va_url_params". If you are using (1), you could just add sysparm_skip_load_history=true to the this option. If you are using (2) see my recent article on Adding instance options to directly embedded Service Portal Widgets. If you are using (3), on the Service Portal Agent Chat Configurations record, you could just add skip_load_history: true.
This will give you either no or all history.
Concerning just 2 days... you could cleanup history records or restrict them through ACL's. Though that would be customization and where changing out-of-the-box Access Controls be aware that then you will own them, this will have consequences for futher patches/upgrades. That's up to you if you want that.
What's the actual need to having 2 days of history, instead of all or no history at all?
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2020 02:08 PM
Hi,
I found this on disabling the History completely:
the 'sysparm_skip_load_history=true' is what results in the history not loaded.
See Mark's reply here:
To limit it, you could create an ACL on the tables to limit a user from accessing messages older than the 2 days.
Here is where conversations are stored:
- sys_cs_conversation
- sys_cs_message
One thing to keep in mind is that the read/write ACLs are locked to "maint" OOB. Therefore, you would either have to have "Admin" override boolean checked as true or a new ACL added to the allow list

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2020 12:05 AM
Hi there,
Out-of-the-box, you only can completely disable the history, or show all.
It depends on how you added you Virtual Agent widget to your Service Portal. Through older methods like (1) dragging/dropping the widget onto a SP page, (2) embedding it to the header footer. Or (3) using the current preferred ServiceNow method of applying Agent Chat configuration.
NO need to clone and edit the widget.
The widget has a instance option "va_url_params". If you are using (1), you could just add sysparm_skip_load_history=true to the this option. If you are using (2) see my recent article on Adding instance options to directly embedded Service Portal Widgets. If you are using (3), on the Service Portal Agent Chat Configurations record, you could just add skip_load_history: true.
This will give you either no or all history.
Concerning just 2 days... you could cleanup history records or restrict them through ACL's. Though that would be customization and where changing out-of-the-box Access Controls be aware that then you will own them, this will have consequences for futher patches/upgrades. That's up to you if you want that.
What's the actual need to having 2 days of history, instead of all or no history at all?
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2020 01:41 AM
Hi Mark,
Thank you so much for quick response.It really helped
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2021 11:12 AM
Hello Mark,
Im following the 3rd option of using Agent Chat configuration record. Not sure where can add this instance option on the script. Can you please let me know how to add it.