How to restrict the fall back topic in virtual agent?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 09:48 AM
Hi all,
I am trying to restrict the fall back topic of virtual agent to 2 attempts as it recognizes two attempts it should ask do you want to connect with live agent?
Note : We are not using the servicenow connect support or agent workspace to route to live agent support, we are providing Skype link once user say talk to live agent.
@mark roethof will you please look into this issue, thank you so much for your quick responses.
Thanks
Shaikha.
- Labels:
-
Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2020 01:07 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2020 01:12 AM
What I'm thinking of is using GlideSession:
https://developer.servicenow.com/dev.do#!/reference/api/paris/server_legacy/c_GlideSessionAPI
GlideSession, because the vaVars/vaInputs etc are not kept when switching between topics. You could use inputs/outputs on a Topic Block, though that would then only be for that specific paren Topic. There is nothing like scratchpad for example for Virtual Agent... so GlideSession is my thought to use.
Have a look at the putClientData and getClientData in the link I mentioned.
I can make an example, but that will be later today due to time.
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
10-23-2020 01:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2020 05:38 AM
So here an example with use of GlideSession.
Outcome, first 2 times the Topic goes left, 3rd time the Topic goes right. In your case, you could build the topic the you would go to a Live Agent at that point.
How did I set this up? Just tested triggering the Fallback topic 3 times in the same session:
Topic really basic for the test:
The scripting on "Get GlideSession":
(function execute() {
var session = gs.getSession();
session.putClientData('fallback_topic_count', parseInt(session.getClientData('fallback_topic_count') || 0) + 1);
gs.info('>>> DEBUG: ' + session.getClientData('fallback_topic_count'));
})()
The scripting on the Decision Transitions (count = 3 for example, the other transition obviously uses ">" instead of "=="):
(function execute() {
var session = gs.getSession();
var answer = false;
if(parseInt(session.getClientData('fallback_topic_count')) == 3) {
answer = true;
}
return answer;
})()
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
11-14-2021 11:21 PM
Nice Explanation.