- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 03-04-2022 05:38 AM
Hi All!
In this article I will explain how you can create a Pre-Chat Survey and use the answers in a Queue filter.
Problem: Sort Agent Chat Queue by language choice of the user.
0. Make sure Agent Chat plugin is installed
1. Create a Survey and make sure to mark it as a Pre-Chat Survey in the options
2. In Survey Designer, create a Choice question for Language Choice
If Pre-Chat survey is set to true, then you will see the Context field here which will show all fields related to Interaction. From there select Language
In Choices you can type the display value. Keep in mind the display value is used later in script.
3. Link the Survey to the Agent Chat.
Conversational Interfaces -> Pre-Chat Survey -> New
Create a New Chat Survey and set the Survey you created as the reference
4. Create a Queue item
Advanced Work Assignment -> Queues
Make sure to set the Service Channel to Chat, Condition mode to Advanced. In the Advanced code we use the Display Value from the choice variable we created in the Survey in Step 2. Also make sure to have Assignment Eligibility set in order to ensure a group is set for the language.
(function executeCondition(/* glide record */ current) {
var contextTable = current.getValue('context_table');
var interactionBlobRecord = new GlideRecord(contextTable);
interactionBlobRecord.addQuery('sys_id',current.getValue('context_document'));
interactionBlobRecord.query();
if(interactionBlobRecord.next()){
var jsonBlob = JSON.parse(interactionBlobRecord.getValue('value'));
if(jsonBlob.liveagent_language == 'English')
return true;
}
return false;
})(current);
The field is called from a table that stores the interaction as json
/interaction_json_blob_list.do Use this for troubleshooting.
6. Impersonate someone from the group, in this case "IT Support". Make sure the user has awa_agent role and log into workspace to receive the chat. Other user from /sp can initiate the dialogue and voila 🙂 Oh, and Agent Chat has to be enabled on the Service Portal too of course
Let me know if any questions below
- 1,660 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello! Thank you for the detailed guide, it explains things very well. I followed it step by step on a brand new instance (PDI) and it appears it is not working correctly. I'm wondering if more configuration is required. The choices appear on the chat and are selectable, but once selected it does not route me to the queue, it looks like it's going to a Virtual Agent topic. Let me know if I need to check anywhere else! I've been trying to perfect my queue routing for days and have had no luck. I'm trying to avoid using VA topics and upgrading my Virtual Agent Lite, so this guide provides a great solution and I want to make it work!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This started happening in the recent versions of ServiceNow. They don't let you install Agent Chat without the Virtual Agent Lite - so the Virtual Agent Lite has to now be turned off. In order to do this, you have to set a sys_properties value:
com.glide.cs.live_agent_only
Set this to True and your SP widget will be Agent Chat mode only.