1.3 - Filter Contact History by Keyname: Exact Text - Vantage Customer Experience

Vantage Customer Experience User Guide

prodname
Vantage Customer Experience
vrm_release
1.3
created_date
December 2020
category
User Guide
featnum
B035-3800-099K
Use Keyname to filter Contact History data in a Rules expression. Keynames do not change for an object and, in most cases, are unique for specific object types in an Organization within a specific environment.
Keyname is case-sensitive when used in expressions.

Example 1

Criteria:
-Qualify if:
-Message M1 has been extended or responded to the customer
 
Expression:
set("extendedOrResponded", contactHistory("message", "msg1")) &&
count(extendedOrResponded) > 0

In this example, the Keyname of Message 'M1' is 'msg1'. This can be found in the Message details page.

Three expression functions are used here:
set
Sets an arbitrary extendedOrResponded variable in the Rules evaluation context.

The variable holds the evaluation result of the subexpression on the right, contactHistory.

contactHistory
Handles Contact History data retrieval and filtering.
In this example, the keyword message is used with Message Keyname. This triggers the contactHistory function to filter Contact History data based on Message Keyname. In pseudo-SQL, this is similar to running the following query:
select * from contact_history_table where message_keyname = 'msg1'
The result is a List of Contact History data matching the given criteria.
count
Takes a List and evaluates the right hand operator, resulting in either true or false.

The boolean result represents the final result of the entire Rule expression.

Example 2

Criteria:
-Qualify if:
-Any Message has been extended or responded in Channel 'SMS'
 
Expression:
set("extendedOrResponded", contactHistory("channel", "sms")) &&
count(extendedOrResponded) > 0
Similar to Example 1, this Rule expression filters Contact History data by using the Channel 'SMS' Keyname, which in this case is 'sms'. This is similar to running the following SQL query:
select * from contact_history_table where channel_keyname = 'sms'

The resulting List is then evaluated by the count function.

Example 3

Criteria:
-Qualify if:
-A Message has been extended or responded to the customer
-In any Channel
-For Message Strategy 'Recharge'
 
Expression:
set("extendedOrResponded", contactHistory("messageStrategy", "recharge")) &&
count(extendedOrResponded) > 0
In this case, Message Strategy 'Recharge' Keyname, which is 'recharge', is used to filter Contact History data. This is similar to running the following SQL query:
select * from contact_history_table where message_strategy_keyname = 'recharge'

No other conditions are needed in the expressions. The resulting List is evaluated by the count function.