I want to restrict the chat history shown on the bot to 2 days instead of the whole history. How to do this?

khyati4
Tera Contributor

I want to restrict the chat history shown on the bot to 2 days instead of the whole history. How to do this?

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn

View solution in original post

5 REPLIES 5

Willem
Giga Sage
Giga Sage

Hi,

I found this on disabling the History completely:

find_real_file.png

the 'sysparm_skip_load_history=true' is what results in the history not loaded.

See Mark's reply here:

https://community.servicenow.com/community?id=community_question&sys_id=2ccdc86ddb9c7784e0e80b55ca96...

 

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

https://community.servicenow.com/community?id=community_question&sys_id=14412551dbbcaf40a39a0b55ca96...

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn

Hi Mark,

Thank you so much  for quick response.It really helped

 

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.