Advanced Personalization with Liquid
A list of the Liquid filters and tags you can use when sending messages.
This is a list of the Liquid filters and tags you can use in Hackle CRM campaigns. Tags and filters that are not on this list may not work, and in most cases they are converted to an empty string.
Available Variables
Through the personalization variable modal in the Dashboard, you can reference values that differ for each user.
{{ user_properties.<key> }}
User Property
{{ event_properties.<key> }}
Event Property
{{ api_properties.<key> }}
API Property
{{ identifiers.<type> }}
Identifier (available only on Webhook channel)
Example: Hello {{ user_properties['name'] }}
Common Patterns
Use a default value when the name is missing
Use fallback text when a variable has no value.
Hello {{ user_properties.name | default: 'Customer' }}→ Hello Customer (when name is missing)
Thousands separators for numbers
Display points, amounts, and similar values in a readable form.
Variable: point = 15000
→ 15,000P
Show a date in Korean time and language
Convert to Asia/Seoul and print the weekday in Korean.
Variable: ordered_at = "2026-07-15 23:00:00 UTC"
→ 07월 16일 목요일
Replace values that are too long with fallback text
Values longer than the specified length are replaced entirely.
Variable: name = "Bartholomew" (11 characters)
→ Hello Customer
Quick Reference
Filters
append
Appends another string to the end of a string.
prepend
Prepends another string to the beginning of a string.
capitalize
Capitalizes the first character and leaves the rest unchanged.
downcase
Converts all characters to lowercase.
upcase
Converts all characters to uppercase.
lstrip
Removes whitespace from the left (beginning) of a string.
rstrip
Removes whitespace from the right (end) of a string.
strip
Removes whitespace from both ends of a string.
strip_html
Removes HTML tags from a string.
strip_newlines
Removes newline characters from a string.
newline_to_br
Replaces newline characters with <br /> tags.
remove
Removes every occurrence of a substring from a string.
remove_first
Removes only the first occurrence of a substring from a string.
replace
Replaces every occurrence of a substring with another string.
replace_first
Replaces only the first occurrence of a substring with another string.
split
Splits a string on a delimiter to build an array.
slice
Cuts out part of a string by start position and length.
truncate
Shortens a string to the specified length and appends an ellipsis.
truncatewords
Shortens a string to the specified number of words and appends an ellipsis.
escape
Escapes HTML special characters in a string.
escape_once
Escapes HTML special characters in a string, without re-escaping parts that are already escaped.
abs
Returns the absolute value of a number.
at_least
Returns the specified minimum if the number is smaller than it.
at_most
Returns the specified maximum if the number is larger than it.
ceil
Rounds a number up to an integer.
floor
Rounds a number down to an integer.
round
Rounds a number to the nearest value.
plus
Adds numbers.
minus
Subtracts numbers.
times
Multiplies numbers.
divided_by
Divides numbers.
modulo
Returns the remainder of a division.
number_with_delimiter
Adds thousands separators (commas) to a number.
compact
Removes nil values from an array.
concat
Concatenates two arrays.
first
Returns the first element of an array.
last
Returns the last element of an array.
join
Joins the elements of an array with a delimiter to build a string.
map
Extracts only the specified property value from each element to build a new array.
reverse
Reverses the order of an array.
sort
Sorts an array (case-sensitive, uppercase first).
sort_natural
Sorts an array without regard to case.
uniq
Removes duplicate values from an array.
where
Keeps only the elements that have the specified property value.
size
Returns the number of elements in an array, or the length of a string.
date
Converts a date/time value into a string in the specified format.
url_encode
URL-encodes a string.
url_decode
Decodes a URL-encoded string back to its original form.
url_escape
Escapes only the characters in a string that cannot be used in a URL.
url_param_escape
Escapes a string for use as a URL query parameter value.
json_escape
Safely escapes a string for use as a JSON string value.
json_parse
Parses a JSON string into an object that can be accessed in the template.
as_json_string
Serializes a value into a JSON string.
default
Returns a fallback value when the value is empty or falsy.
fallback_over_length
Returns fallback text when the string exceeds the specified length.
Tags
assign
Assigns a value to a variable.
capture
Stores the rendered result of a block in a variable.
if
Renders the block only when the condition is true.
unless
Renders the block only when the condition is false.
case / when
Renders one of several branches depending on a value.
for
Iterates over an array or a range, rendering the block repeatedly.
break
Immediately exits a for loop.
continue
Skips the current iteration of a for loop and moves on to the next one.
cycle
Outputs several values in turn, one per iteration.
comment
Does not output the content inside the block.
raw
Outputs the content inside the block as-is, without interpreting Liquid syntax.
increment
Increments and outputs a dedicated counter that starts at 0.
decrement
Decrements and outputs a dedicated counter that starts at -1.
connected_content
Calls an external API and stores the response (JSON) in a template variable.
random
Generates and outputs a random number.
String Filters
append
Appends another string to the end of a string.
→ Spring breeze blows
prepend
Prepends another string to the beginning of a string.
→ falling petals
capitalize
Capitalizes the first character and leaves the rest unchanged.
→ Spring bloom
downcase
Converts all characters to lowercase.
→ blossom
upcase
Converts all characters to uppercase.
→ PETAL
lstrip
Removes whitespace from the left (beginning) of a string.
→ [sprout ]
rstrip
Removes whitespace from the right (end) of a string.
→ [ sprout]
strip
Removes whitespace from both ends of a string.
→ [sprout]
strip_html
Removes HTML tags from a string.
→ Important notice
strip_newlines
Removes newline characters from a string.
→ Summeris here
newline_to_br
Replaces newline characters with <br /> tags.
→ When the cicadas sing<br /> summer has arrived
remove
Removes every occurrence of a substring from a string.
→ night night
remove_first
Removes only the first occurrence of a substring from a string.
→ night summer night
replace
Replaces every occurrence of a substring with another string.
→ summer sky, summer sky
replace_first
Replaces only the first occurrence of a substring with another string.
→ sun-rain-rain
split
Splits a string on a delimiter to build an array. Because the result is an array, the example uses join as well.
→ sea / watermelon / shower
slice
Cuts out part of a string by start position and length.
Signature: slice: start[, length]
→ summer
→ sea
truncate
Shortens a string to the specified length and appends an ellipsis.
Signature: truncate: length[, ellipsis]
→ The autumn sky...
Note: the ellipsis counts toward the length — with the default ellipsis (...), the visible body is length - 3 characters, and if you specify your own ellipsis, its length is subtracted instead.
truncatewords
Shortens a string to the specified number of words and appends an ellipsis.
Signature: truncatewords: word_count[, ellipsis]
→ Leaves turn red...
escape
Escapes HTML special characters in a string.
→ <a href="x">link</a>
escape_once
Escapes HTML special characters in a string, without re-escaping parts that are already escaped.
→ <p> & <p>
Number Filters
abs
Returns the absolute value of a number.
→ 5
at_least
Returns the specified minimum if the number is smaller than it.
→ 5
at_most
Returns the specified maximum if the number is larger than it.
→ 5
ceil
Rounds a number up to an integer.
→ 2
floor
Rounds a number down to an integer.
→ 1
round
Rounds a number to the nearest value.
Signature: round: [decimal_places]
→ 3
→ 3.14
plus
Adds numbers.
→ 125
minus
Subtracts numbers.
→ 75
times
Multiplies numbers.
→ 300
divided_by
Divides numbers.
→ 3
→ 3.3333333333333335
Note: dividing integers yields an integer quotient (the decimal part is dropped). If you need a decimal result, divide by a float such as 3.0.
modulo
Returns the remainder of a division.
→ 1
number_with_delimiter
Adds thousands separators (commas) to a number.
→ 1,234,567.89
Array Filters
compact
Removes nil values from an array.
→ maple,leaf
concat
Concatenates two arrays.
→ a,b,c
first
Returns the first element of an array.
→ apple
last
Returns the last element of an array.
→ chestnut
join
Joins the elements of an array with a delimiter to build a string.
→ apple, persimmon, chestnut
map
Extracts only the specified property value from each element to build a new array.
→ maple, ginkgo
reverse
Reverses the order of an array.
→ chestnut,persimmon,apple
sort
Sorts an array (case-sensitive, uppercase first).
→ Banana,Cherry,apple
Note: sort is case-sensitive (uppercase first), while sort_natural ignores case — the output above shows the difference.
sort_natural
Sorts an array without regard to case.
→ apple,Banana,Cherry
uniq
Removes duplicate values from an array.
→ a,b
where
Keeps only the elements that have the specified property value.
Signature: where: property[, value]
→ camellia
size
Returns the number of elements in an array, or the length of a string.
→ 3
→ 11
Date Filters
date
Converts a date/time value into a string in the specified format.
Signature: date: format[, timezone][, locale: "language_tag"]
→ July 16, 2026 10:30
→ 2026-07-16 08:00
→ 목요일
→ 07월 16일 목요일
→ 2026-07-16 10:30
Note:
An ISO
Zsuffix on a date string is not parsed (2026-07-16T10:30:00Z✗) — use a space-separated zone (2026-07-16 10:30:00 UTC) or a format without a zone.Numeric input is interpreted in epoch seconds.
timezone supports TZ names (
Asia/Seoul) and ISO offsets (+09:00), but not numeric minute offsets (360).An invalid timezone or locale causes only that parameter to be ignored.
timezone (a positional argument) and
locale:(a named argument) can be used together, in any order.
URL Filters
url_encode
URL-encodes a string.
→ user%40example.com
url_decode
Decodes a URL-encoded string back to its original form.
→ hello world!
url_escape
Escapes only the characters in a string that cannot be used in a URL.
→ https://example.com/search?q=hello%20world
url_param_escape
Escapes a string for use as a URL query parameter value.
→ query+A%26B
JSON Filters
json_escape
Safely escapes a string for use as a JSON string value.
→ He said \"hello\"
json_parse
Parses a JSON string into an object that can be accessed in the template.
→ Alex's points: 1500
Note: if parsing fails, the result is nil and rendering continues.
as_json_string
Serializes a value into a JSON string.
→ {"name":"Alex","point":1500}
Other Filters
default
Returns a fallback value when the value is empty or falsy.
Signature: default: default_value
→ Hello traveler
fallback_over_length
Returns fallback text when the string exceeds the specified length.
Signature: fallback_over_length: max_length, fallback_text
→ traveler
→ snow
Note: length is measured in UTF-16 code units (the same as the size filter).
Tags
assign
Assigns a value to a variable.
→ Hello Hackle
capture
Stores the rendered result of a block in a variable.
→ Welcome, Alex
if
Renders the block only when the condition is true.
→ VIP benefits
unless
Renders the block only when the condition is false.
→ Start your subscription
case / when
Renders one of several branches depending on a value.
→ Gold benefits
for
Iterates over an array or a range, rendering the block repeatedly.
→ tangerine citron dried persimmon
break
Immediately exits a for loop.
→ 123
continue
Skips the current iteration of a for loop and moves on to the next one.
→ 1245
cycle
Outputs several values in turn, one per iteration.
→ ABAB
comment
Does not output the content inside the block.
→ beforeafter
raw
Outputs the content inside the block as-is, without interpreting Liquid syntax.
→ {{ name }} is not substituted
increment
Increments and outputs a dedicated counter that starts at 0.
→ 0-1-2
Note: increment starts at 0 and decrement starts at -1, and both use a counter that is separate from assign variables.
decrement
Decrements and outputs a dedicated counter that starts at -1.
→ -1--2
Other Tags
connected_content
Calls an external API and stores the response (JSON) in a template variable.
For detailed usage and limits (timeout, response size cap, allowed protocols and addresses, and so on), see Writing Connected Content.
Signature: {% connected_content <url> [:method <method>] [:body <body>] [:headers <json>] [:save <variable>] %}
→ Hi Alex, check out today's recommended products (assuming the API responded with {"name": "Alex"})
Note: an actual HTTP call is made at render time. The output above is an example based on the assumed response.
random
Generates and outputs a random number. Pass a positive integer to get a random integer that is 0 or greater and less than that value.
→ 0.250538241955663 (differs on every run)
→ 7 (differs on every run)
Rolling a die (1~6) — to store the drawn value in a variable and reuse it, capture it with capture and convert it to a number with plus. {% random 6 %} returns 0-5, so plus: 1 makes it 1-6.
→ 4 (differs on every run)
Last updated