Skip to main content
Version: 5.x

Query Data

Data lookup requests from the gadget to the ServiceNow platform may occur in different ways. The most frequent instances are associated with Directory Lookups (typing a value into the gadget's search field) or Participant Lookups (identifying a caller).

info

Please note that the logged in ServiceNow user must have read access to query the records defined by the configuration. If the user is not allowed to read these records, null will be returned.

Configuration for all features is almost identical. The only differences are in the parameters passed from the gadget to the ServiceNow platform.

b+s Connects for ServiceNow offers two modes to configure date lookup: simple and advanced.

Steps 1-3 below explain how to configure data lookups in a ServiceNow instance.

info

ServiceNow role required: admin, x_busag_cnx.CC Administrator or x_busag_cnx.CC Supervisor

Simple Participant lookup

Step by step instructions:

  1. Login to ServiceNow Service Management as administrator.
  2. Go to Service Layout by searching in the left panel. Then click New to create a new record or choose an existing Service Layout record.
  3. Enter a Name and Description to help identify the data lookup being used.

Simple Data Lookup

The easiest way to query data is to configure one Lookup table (ServiceNow table) in which to search for information. The default table is sys_users, which contains records for every ServiceNow user. However, it is possible to search in any available table in ServiceNow.

Next configure a Lookup query string. This value contains the filter with which the records in a given table are queried. This value is known as an encoded query string, and is very similar to the ServiceNow URL schema. Useful information on generating query strings is available in the Tips & Tricks section.

For more information please visit the Generate an encoded query string through a filter guide in the ServiceNow documentation.

To complete the configuration, provide a "Lookup result" (this defines which fields to return). The correct format is similar to a standard URL: Key1=${fieldA}&Key2=${fieldB}, where Key is the identifier for the gadget, and ${fieldA} is the place holder for the resulting field value.

Advanced Data Lookup

To query information from more than one table, a custom lookup script is required. A custom lookup script offers the ability to query information using ServiceNow's Scoped GlideRecord.

For more information please visit the GlideRecord - Scoped guide in the ServiceNow documentation.

The resulting data must be written to the result object.

Advanced Participant lookup

The following data from b+s Connects can be used in advanced lookup scripts:

Variable nameDescriptionAvailable for
searchSearch string entered by the agent into the search field.Directory Lookup
serviceLayoutUnique identifier (sys_id) of the used service layout. Can be used to query the correct directory numbers.Directory Lookup
workitem.BAAccountNumberCustomer account number available in the import file (Campaign calls only)Participant Lookup
workitem.BABuddyNameIf available in the import file, contains the customers first and last name separated by commas (Campaign calls only)Participant Lookup
workitem.BACampaignOutbound option campaign to which the call belongs (Campaign calls only)Participant Lookup
workitem.BACustomerNumberDialed customer phone number (Campaign calls and UCCX only)Participant Lookup
workitem.BADialedListIDUnique key identifying a specific customer record within the Dialing List (Campaign calls only)Participant Lookup
workitem.BAResponseMulti-purpose placeholder for sending data (Campaign calls only)Participant Lookup
workitem.BAStatusIndicates mode and direction of the Outbound Option Dialer initiated call (Campaign calls only)Participant Lookup
workitem.BATimeZoneIndicates the GMT offset, in minutes, for the customers time zone. Used to obtain customers local time (Campaign calls only)Participant Lookup
workitem.callKeyCallIdCisco Finesse Call Key Call ID -> Router Call Key (CCE only)Participant Lookup
workitem.callKeyPrefixCisco Finesse Call Key Prefix -> Router Call Key Day (CCE Only)Participant Lookup
workitem.callTypeCisco Finesse Call TypeParticipant Lookup
workitem.callVariable1Cisco Contact Center call variable 1Participant Lookup
...
workitem.callVariable10Cisco Contact Center call variable 10Participant Lookup
workitem.classificationCall Classification
Customer -> Call with customer or other external participant
Consultation -> Consultation call
Conference -> Conference call
Transfer -> Call which was answered by a different agent and transferred to the current one.
Internal -> Internal call. Identified using Internal number regex
Monitor -> Supervisor monitoring a call. Only available for supervisor agents
Unknown -> Call of an unknown classification.
Campaign -> Campaign call
CampaignPreviewReservation -> Campaign preview / direct preview reservation call
CampaignPreview -> Campaign preview / direct preview call
Participant Lookup
workitem.dialedNumberCisco Finesse Dialed NumberParticipant Lookup
workitem.DNISCisco Finesse DNISParticipant Lookup
workitem.mediaIdCisco Finesse Media IDParticipant Lookup
workitem.outboundClassificationCisco Finesse Outbound ClassificationParticipant Lookup
workitem.queueNameCisco Finesse Queue NameParticipant Lookup
workitem.queueNumberCisco Finesse Queue NumberParticipant Lookup
workitem.user.eccVariableNameCisco Contact Center extended call variable. The name is dependent on the ECC variable nameParticipant Lookup
workitem.wrapUpReasonCisco Finesse Wrap-Up ReasonParticipant Lookup

Example Scripts can be found under Advanced Script Examples.

Most data query examples use CONTAINS or ENDSWITH operators in their WHERE clauses. The advantage is that these queries are very predictable and can specify exactly which fields are searched. But the disadvantage is, that these operators do not use an index, which can cause performance problems with large tables. In this case it is recommended using the keyword based search provided by ServiceNow for the data query.

Keyword based search can be used for all data queries in b+s Connects for ServiceNow and is available for both Simple Data Lookups and Advanced Data Lookups. One example:

GOTO123TEXTQUERY321=*${search}* | ${search}

For more information please visit the Zing text indexing and search engine documentation.

Possible Variables

The following variables can be displayed:

ValueDescription
callVariable1Cisco Contact Center call variable 1
...
callVariable10Cisco Contact Center call variable 10
user.eccVariableNameCisco Contact Center Extended call variable. The name is dependent on the ECC Variable name
callTypeCisco Finesse Call Type
DNISCisco Finesse DNIS
dialedNumberCisco Finesse Dialed number
numberCisco Finesse ANI. Number is displayed like it is received from Finesse
outboundClassificationCisco Finesse Outbound classification
callKeyCallIdCisco Finesse Call Key Call ID -> Router call Key (CCE only)
callKeyPrefixCisco Finesse Call Key Prefix -> Router call Key Day (CCE only)
mediaIdCisco Finesse Media ID
queueNameCisco Finesse Queue Name
queueNumberCisco Finesse Queue Number
wrapUpReasonCisco Finesse Wrap-Up Reason
BACampaignOutbound Option campaign to which the call belongs
BAAccountNumberCustomer account number available in the import file
BAResponseMulti-purpose placeholder for sending data
BAStatusIndicates mode and direction of the Outbound Option Dialer initiated call
BADialedListIDUnique key identifying a specific customer record within the Dialing List
BATimeZoneIndicates the GMT offset, in minutes, for the customer’s time zone and is used to obtain the customer’s local time
BABuddyNameContains the customer’s first and last name separated by a comma, if available in the import file
BACustomerNumberContains the dialed customer phone number (UCCX only)
info

Refer to the Cisco Finesse documentation for more information about these variables.

info

For variables available in advanced lookup scripts, please refer to Advanced Data Lookup