Writing Queue Queries using the Advanced Query Editor
Add queries to queues for CxEngage to search for and route calls to resources or groups of resources. Use queries to target:
- Specific resources or groups
- Resources with certain skills
- Resources with specific proficiencies or who lie within a range of proficiencies
You can build queries with resources, comparators, logical operators, and list operations.
Note: If you prefer, you can use the query builder to create your queue query. See Creating Queue Queries using the Basic Query Builder.
Building Queries
A query is made of up one or more resources. Resources are the names and values CxEngage searches for. Use these resources when you build a query:
Resource | Description |
---|---|
id | The unique system identifier for an agent, a tenant, or a resource. |
groups | The ID for a user group in CxEngage. |
skills |
The ID of a skill that has been added to CxEngage. |
Proficiency | The proficiency level of a skill that has been added to CxEngage with it's "Has Proficiency" setting enabled. |
When you build queries, ensure that you:
- Surround the query with curly braces ({ and })
- Surround IDs with quotation marks
Each skill, user, and group has a unique identifier to include in queries. See Finding Object IDs for instructions on locating user, skill, and group IDs.
- Include a colon before the name of a resource.
Example 1: Routing Calls to a Group
This query indicates that the resource must be a member of the group listed. For example, if the group ID in the query ( bd0ae6f0-8977-11e5-b0a6-83994ca19835) corresponds to the Insurance Sales group, then the query searches for a resource that is part of the Insurance Sales group.
{:groups (some #{"bd0ae6f0-8977-11e5-b0a6-83994ca19835"})}
Example 2: Routing Calls to Resources with a Specific Skill Proficiency
This query indicates that the resource must have a proficiency level of exactly 50 for the given skill. For example, if the ID in the query (54470710-8978-11e5-b0a6-83994ca19835) corresponds to the French skill, this query searches for a resource with a French skill equal to 50.
{:skills {"54470710-8978-11e5-b0a6-83994ca19835" (= 50)}}
Queries that find resources with a specific skill and proficiency can be restrictive. You can make your queries more flexible with comparators, logical operators, and list operations.
Using Comparators
With comparators, you can expand the scope of your queries by specifying ranges and boundaries for searches. For example, your queries can search for:
- Values above a certain number
- Values below a certain number
- One of several values
If a skill has a proficiency associated with it, enter the numerical value of the skill. For example, if the proficiency is set on a scale of 1 to 100, you can enter 75 as the value. If a skill doesn't have Has Proficiency enabled, resources either have the skill or they don't. Enter the value "1" for true and "0" for false.
Use these comparators with queries:
Comparator | Description |
---|---|
> | Greater than |
>= | Greater than or equal to |
< | Less than |
<= | Less than or equal to |
= | Equal to |
missing | The value doesn't exist. The resource does not have the skill or isn't part of the group listed. |
#{ } | The value is one of the values inside the curly braces |
Example 1: Routing Calls to Resources Without a Certain Skill Listed
This query indicates that the resource doesn't have a certain skill listed. It does not search for resources that have the skill listed in their user details with a proficiency of "0".
For example, if the skill ID included in the query (65b37a10-8978-11e5-b0a6-83994ca19835) corresponds to the Sales skill, the query looks for a resource that doesn't have Sales listed as a skill in their user details. Therefore, it could find a user that only has French and Technical Support skills listed.
{:skills {"65b37a10-8978-11e5-b0a6-83994ca19835" (missing)}}
Example 2: Routing Calls to Resources with a Certain Skill Proficiency
This query searches for resources that have a skill proficiency greater than or equal to 50. For example, if the skill ID listed in the query (54470710-8978-11e5-b0a6-83994ca19835) corresponds to the French skill, the query could find a resource who has a French proficiency level of 54.
{:skills {"54470710-8978-11e5-b0a6-83994ca19835" (>= 50)}
Using Logical Operators
Logical operators let you search for resources that match a range of criteria or which match two specific criteria. Use these logical operators in your queries:
Operator | Description |
---|---|
or | One of the values must be true |
and | All of the values must be true |
Example 1: Routing Calls Using the "And" Operator
This query searches for a resource who's proficiency in a specific skill is between 50 and 75. For example, if the ID listed in the query (54470710-8978-11e5-b0a6-83994ca19835) corresponds to French, the query searches for any resource that has a French proficiency between 50 and 75. A resource with a French proficiency of 68 would be valid.
{:skills {"54470710-8978-11e5-b0a6-83994ca19835" (and (>= 50) (<= 75))}}
Example 2: Routing Calls Using the "Or" Operator
This query searches for a resource who's proficiency either equals 1 or is greater than 80. For example, if the ID listed in the query (54470710-8978-11e5-b0a6-83994ca19835) corresponds to French, the query could find a resource that has a French proficiency of 91 or a resource that has a French proficiency of 1.
{:skills {"54470710-8978-11e5-b0a6-83994ca19835" (or (= 1) (>= 80))}}
Using List Operations
With list operations, you can search for resources who match one or more of the criteria in a list of criteria. You can use these list operators with your queries:
Operation | Description |
---|---|
some | At least one element in the list is true |
all | All elements in the list must be true |
Example 1: Routing Calls to Resources in One or More Groups
This query searches for members of any of the groups listed in the query. For example, if the group IDs listed in the query correspond to Pre-Sales Support (84847ea0-4fec-11e5-8ed9-c1ae7ae4ed37) and Technical Support (79ac9b90-6930-11e5-953d-c1ae7ae4ed37), the query searches for resources in either of the groups. The call could be routed to resources that are only in the Pre-Sales Support group, only in the Technical Support group, or in both groups.
{:groups (some #{"84847ea0-4fec-11e5-8ed9-c1ae7ae4ed37" "79ac9b90-6930-11e5-953d-c1ae7ae4ed37"})}
Example 2: Routing Calls to Resources in All Groups
This query searches for members of all of the groups listed in the query. For example, if the group IDs listed in the query correspond to Pre-Sales Support (84847ea0-4fec-11e5-8ed9-c1ae7ae4ed37) and Technical Support (79ac9b90-6930-11e5-953d-c1ae7ae4ed37), the query only searches for resources that are members of both of those groups.
{:groups (all #{"84847ea0-4fec-11e5-8ed9-c1ae7ae4ed37" "79ac9b90-6930-11e5-953d-c1ae7ae4ed37"})}
Combining Skills and Groups in a Query
You can combine skills and groups in the same query if, for example, you want to route calls to resources with a specific skill or proficiency in a group. Additionally, you can add multiple skills with different proficiency criteria to a query.
Example 1: Routing Calls to Resources in a Specific Group with a Specific Skill Proficiency
This query searches for resources that are members of both the groups listed and that also have a proficiency that is equal to or greater than 50 for the skill included. For example, if the group IDs correspond to Technical Support and Pre-Sales Support, and the skill ID corresponds to French, the query could find a resource that is a member of both the Technical Support and Pre-Sales Support group that also has a French proficiency of 72.
{:groups (all #{"bd0ae6f0-8977-11e5-b0a6-83994ca19835" "84847ea0-4fec-11e5-8ed9-c1ae7ae4ed37"})
:skills {"54470710-8978-11e5-b0a6-83994ca19835" (>= 50)}}
Example 2: Routing Calls to Resources with Multiple Skill Proficiencies
This query searches for a resource that has one specific skill that is greater than or equal to 50 and another specific skill that is greater than or equal to 1. For example, if the first skill ID corresponds to French and the second ID corresponds to Sales, the query could find a resource that has a French proficiency of 65 and a Sales skill of 3.
{:skills {"54470710-8978-11e5-b0a6-83994ca19835" (>= 50)
"65b37a10-8978-11e5-b0a6-83994ca19835" (>= 1)}}
Note: The value "1" can either mean:
- The resource's proficiency level is "1" if Has Proficiencyis enabled on the skill
- The resource has the skill if there if Has Proficiencyis not enabled on it.