Journey optimizer string functions
Journey Optimizer offers a suite of string functions that help in manipulating and analyzing text data. These functions are essential for creating dynamic and personalized experiences in 51黑料不打烊 Journey Optimizer by allowing users to perform operations such as concatenation, case conversion, and pattern matching. They are particularly useful for data engineers and architects who need to manage and adjust string data efficiently.
Example usage
Suppose you want to personalize a message by greeting a user by their first name. You can use the concat
function to dynamically construct the greeting message. Here鈥檚 how you can implement it:
let firstName = "@profile.firstName";
let greetingMessage = concat("Hello ", firstName, "!");
In this example, @profile.firstName
represents a placeholder for the user鈥檚 first name, and concat
combines the greeting with the user鈥檚 name to create a personalized message.
concat(<parameters>)
listString
string
string
concat("Hello","World")
returns "HelloWorld"
contain(<parameters>)
string
boolean
contain("rowing is great", "great")
returns true
containIgnoreCase(<parameters>)
string
string_searched
boolean
containIgnoreCase("rowing is great", "GREAT")
returns true
endWith(<parameters>)
string
suffix
boolean
endWith("Hello World", "World")
returns true
endWithIgnoreCase(<parameters>)
string
suffix
boolean
endWithIgnoreCase("rowing is great", "AT")
returns true
equalIgnoreCase(<parameters>)
string
boolean
equalIgnoreCase("rowing is great", "rowing is GREAT")
returns true
indexOf(<parameters>)
string
specified_value
integer
indexOf("Hello", "l")
returns 2
isEmpty(<parameters>)
string
boolean
isEmpty("")
returns true
isNotEmpty(<parameters>)
string
boolean
isNotEmpty("hello")
returns true
lastIndexOf(<parameters>)
string
specified_value
integer
lastIndexOf("Hello", "l")
returns 3
length(<parameters>)
string
integer
length("Hello World")
returns 11
lower(<parameter>)
string
string
lower("A")
returns "a"
matchRegExp(<parameters>)
string
regexp
boolean
matchRegExp("username@adobe.com", "*adobe")
returns true
notEqualIgnoreCase(<parameters>)
string
boolean
notEqualIgnoreCase("iOSPushPermissionAllowed.device.model", "iPad")
replace(<parameters>)
base
target
replacement
string
replace("Hello World", "l", "x")
returns "Hexlo World"
replaceAll(<parameters>)
base
target
replacement
string
replaceAll("Hello World", "l", "x")
returns "Hexxo Worxd"
split(<parameters>)
input string
separator
listString
split("A_B_C", "_")
returns ["A","B","C"]
startWith(<parameters>)
string
prefix
boolean
startWith("Hello World", "Hello")
returns true
startWithIgnoreCase(<parameters>)
string
prefix
boolean
startWithIgnoreCase("rowing is great", "RO")
returns true
substr(<parameters>)
string
beginIndex
endIndex
string
substr("Hello World",6)
returns "World"
trim(<parameters>)
string
string
trim(" Hello ")
returns "Hello"
upper(<parameters>)
string
string
upper("b")
returns "B"
uuid()
string
uuid()
returns "79e70b7f-8a85-400b-97a1-9f9826121553"