Einstein Email Data Strings
The following strings can be used for formatting and sanitizing Einstein Email Recommendation data. These strings differ from other system personalization strings in that they behave similar to a function, where the string value is interpreted based on arguments within the string construct.
String | Description | Example Output |
---|---|---|
RegularPriceMain |
Outputs the integer part (before the decimal) of the field mapped to RegularPrice or Price for streaming updates |
65 |
SalePriceMain |
Outputs the integer part (before the decimal) of the field mapped to SalePrice
|
42 |
RegularPriceFractional |
Outputs the fractional part (integer after the decimal) of the field mapped to RegularPrice or Price for streaming updates |
99 |
SalePriceFractional |
Outputs the fractional part (integer after the decimal) of the field mapped to SalePrice for streaming updates |
50 |
ToFloat |
Converts the value of a string field in a Catalog to a floating-point number | 12.25 |
[a]LongestWordLength |
Calculates the longest word in an attribute and outputs the length of that word as a number, where [a] is the attribute |
For a Description attribute with the string ‘Also available in black’ , %%DescriptionLongestWordLength%% will output 9 . |
[a]LengthNum |
Returns the length of a Catalog attribute, where [a] is the attribute |
For a Description with the string ‘One size only’, %%DescriptionLengthNum%% will output 13 . |
First[n] |
Outputs the first characters of value, where [n] is an integer |
%%SKUFirst5%% will output ABC123
|
Split[d]At[i] |
Splits a value and returns the given index, where [d] is the delimiter and [i] is a zero-based index. The delimiter can be longer than one character and the index can be negative. |
For a Size attribute with the string ‘small;medium;large’ , %%Split;At1%% will output medium . |
[a]Replace[r]With[w]End |
Globally replaces a given string with another string from a Catalog attribute, where [a] is the attribute, [r] is the string to match and [w] is the string to replace |
For a Color attribute with the string ‘Purple’, %%ColorReplacePurpleWithLavenderEnd%% will output Lavender . |
[a]UpTo[n]By[d]With[o]End |
Outputs the value of a Catalog attribute up to an index with an appended string (if included), where [a] is the attribute, [i] is a whole number of characters to evaluate, [d] is the delimiter and [o] is the optional string into append. Values shorter than the limit output unaltered and values without a delimiter that match within the limit output blank. |
For a Size attribute with the string ‘small;medium;large’, %%SizeUpTo14By;With~End%% will output small;medium~ . |