Filter Contact History Attributes: STRING Attributes | Vantage CX - 1.4 - Filter on Contact History Attributes: STRING Attributes - Vantage Customer Experience

Vantage Customer Experience User Guide

prodname
Vantage Customer Experience
vrm_release
1.4
created_date
June 2021
category
User Guide
featnum
B035-3800-099K
STRING Attributes are case-sensitive when used in expressions.

Exact Text Match

Example 1

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last 5 days
-AND Device ID used was 'xyz'
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "day", lessThanOrEqual(5))) &&
set("deviceids", contactHistory(extendedOnChannel, "attribute", "ContactHistory.sms.dcat.deviceid", "xyz")) &&
count(deviceids) > 0

In this example, the Contact History criteria is transformed into four expressions:

  • set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge"))

    Three filters are used here (on Response, Message, and Message Strategy) and the resulting List is placed in the "extendedCH" variable.

    See Using Multiple Keyname Filters.

  • set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "day", lessThanOrEqual(5)))

    This is further filtering Contact History data on Frequency and Recency values. See Filter Contact History on Frequency and Recency Values.

  • set("deviceids", contactHistory(extendedOnChannel, "attribute", "ContactHistory.sms.dcat.deviceid", "xyz"))
    As noted in Filter Contact History on Contact History Attributes, a Contact History Attribute in Rules expression comes in special format. This sub-expression retrieves all the values of the Attribute deviceid from the already filtered Contact History List (from the result of the preceding expression, which is represented by the input variable extendedOnChannel).
    contactHistory(extendedOnChannel, "attribute", "ContactHistory.sms.dcat.deviceid", "xyz")
    Each value is then compared with the right-hand value, in this case, it is an exact match comparison on text xyz. The resulting List is then placed into a variable called "deviceids" using the set expression function.
    This presents the main difference between filtering Contact History on Message, Response, Channel, Message Strategy, and Frequency and Recency values: These filters do not change the structure of the Contact History data. They merely filter the data, i.e., the resulting List of filtered Contact History data is a subset of the original set. With Contact History Attributes, however, the resulting List is a list of Attribute values from the Contact History data. This List can then be used in other expression functions like aggregates, DATE, TIME, string-related functions, and numeric functions.
  • count(deviceids) > 0

    The List of Attribute values from the preceding expression, represented by the deviceids variable, is now used in count expression function. This represents the final evaluation of the entire expression.

Pattern/Regular Expressions

Use STRING Attributes, patterns and regular expressions. See Filter Contact History by Name: Pattern and Regular Expressions.

Example 2

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last 5 days
-AND Device ID used contains the text 'xyz'
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "day", lessThanOrEqual(5))) &&
set("deviceids", contactHistory(extendedOnChannel, "attribute", "ContactHistory.sms.dcat.deviceid", pattern("^((?!xyz).)*"))) &&
count(deviceids) > 0

Example 3

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last 5 days
-AND Device ID used starts with 'RTY100'
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "day", lessThanOrEqual(5))) &&
set("deviceids", contactHistory(extendedOnChannel, "attribute", "ContactHistory.sms.dcat.deviceid", pattern("RTY100.*"))) &&
count(deviceids) > 0