Discard/revert draft changes Virtual Agent Topic /... - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

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

 

Hi there,

 

Performing some changes on a Virtual Agent Topic or Topic Block, accidentally applied some changes, or just for whatever reason having the need to revert the changes made since the last published version? At some point during development within the Virtual Agent Designer, you will come across this situation. Though what can you do about this? There's no default option for this, no button to abort the changes, etcetera.

 

Let's have a close look at this!


Topic / Topic Block records

With for example Workflows, every time you publish a Workflow a new version will be created. Basically a new record within the wf_workflow_version table, and those records contain a flag that indicates if that record is the active published workflow. Virtual Agent does not have a structure like this. Topic and Topic Blocks involve basically two tables: sys_cb_topic and sys_cs_topic.


sys_cb_topic

A sys_cb_topic record is created when you create a Virtual Agent Topic or Topic Block. When doing any changes within the Virtual Agent Designer on an existing Virtual Agent Topic or Topic Block, upon save the sys_cb_topic record is just updated. So the sys_cb_topic record will just be overwritten.

 

"Save" does not make this version (the sys_cb_topic record) a published version available within the Virtual Agent client.


sys_cs_topic

sys_cs_topic records are created when publishing a Virtual Agent Topic or Topic Block for the first time. When there's already an existing sys_cs_topic record, upon "Publish" that record will just be updated. So the sys_cs_topic record will just be overwritten. This is for example different than Workflows, where every time a workflow is published, a new record is generated.

 

Without the sys_cs_topic record, the Topic or Topic Block will not be available in the Virtual Agent client.


Update Versions

As mentioned, there's no default option to discard/revert changes within the Virtual Agent Designer. There's no UI Action or something for this. As many know, ServiceNow does provide "Update Versions" records [sys_update_version].

 

Some background on Update Versions:
"The Update Versions table contains records that represent the state of a customizable object at a particular time."

 

Not for everything within ServiceNow Update Versions are kept. High level you could describe that there are Update Versions kept for Process Records, while Update Versions are not kept for Data. It does involve a bit more, though that's the high-level description you could give this.


Discard/revert draft changes

Knowing sys_cb_topic records are Process Records, these are kept with the Update Versions. So knowing this, we could discard/revert any changes on a draft Virtual Agent Topic / Topic Block reverting to a previous version!

 

Here is an example of a Virtual Agent Topic Block and its sys_cb_topic record. I did manually add the Related List "Versions", as that's not on the Form Layout out-of-the-box (if you are using SNUtils, you can also use "/versions").

 

find_real_file.png

 

On the Related List Versions, all available versions are shown. The top one is the current one. If for whatever reason I would like to go back to the previous version (the second one in the list), just open that record and scroll down to the Related Links:

 

find_real_file.png

 

A related link "Revert to this Version" will be shown. Upon selecting the related link, a pop-up will be presented to confirm your choice. After confirming… you just discarded/reverted the draft changes 😀.

Within the Virtual Agent Designer, the "Unpublished changes: topic" messages should also not be visible anymore when you've got the Virtual Agent Topic or Topic Block on open.

 

find_real_file.png

---


And that's it. Hope you like it. If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Platform Architect @ Quint Technology

2x ServiceNow Developer MVP

2x ServiceNow Community MVP

---

LinkedIn

Comments
dcb
Tera Contributor

Interesting for our team. Thank you for sharing. You would expect this feature to be readily available. 

Version history
Last update:
‎08-12-2024 06:22 AM
Updated by:
Contributors