- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 09:40 AM
My client wants to route chat to different chat queues based on the country location of the user.
Any Idea. how to do it?
Thanks!
Solved! Go to Solution.
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 09:11 PM
Hi There,
Within the topic you can configure the queues for the live agent transfer. You can validate the location of user and connect to live agent.
example script [working - tested]
var location = vaInputs.user.location.getDisplayValue();
if(location == 'India'){
vaVars.LiveAgent_queue = 'f4d701b1b3900300f7d1a13816a8dc8e';
gs.info('India location')
vaSystem.connectToAgent();
}
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 09:11 PM
Hi There,
Within the topic you can configure the queues for the live agent transfer. You can validate the location of user and connect to live agent.
example script [working - tested]
var location = vaInputs.user.location.getDisplayValue();
if(location == 'India'){
vaVars.LiveAgent_queue = 'f4d701b1b3900300f7d1a13816a8dc8e';
gs.info('India location')
vaSystem.connectToAgent();
}
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2020 01:02 PM
I am getting below error
org.mozilla.javascript.EcmaError: "vaVars" is not defined.
Caused by error in sys_script.e572da64db3f581051c7e25cd3961973.script at line 12
9: if (gr.next()) {
10:
11: if (gr.u_work_country.getDisplayValue() == 'Australia') {
==> 12: vaVars.LiveAgent_queue = '86c9d160dbfb981090c9f264f3961985';
13: vaSystem.connectToAgent();
14: }
15: }

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2020 10:17 PM
Try vaSystem.LiveAgent_queue.
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-10-2020 08:10 PM
HI There,
As Mark commented can you try vaSystem instead of vaVars.
vaSystem.LiveAgent_queue = 'sys id of 'chat_queue'';
I tired with vaVars it just works for me and I dont have any variables added,
can you check in collaboration > chats setup, click Context and verify you have - queue (liveagent_queue) present.
And, check if there is a record present here -
https://instance.service-now.com/sys_cs_topic_list.do?sysparm_query=name%3D_live_agent_support_&sysparm_view=
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 02:01 AM
Hi Muralidharan,
Can you please confirm where we have to configure this script ? Is it in Topic table Business rule or any other table?
Regards,
Manoj S