Operators

Liquid supports many operators that can be used in your conditional statements.

Syntax Operator Description
== equals
!= does not equal
> greater than
< less than
>= greater than or equal to
<= less than or equal to
or condition A or condition B
and condition A and condition B
contains checks to see if a string or string array contains a string

Operator Examples

Here are some examples of how these operators could be helpful for your marketing campaigns:

Total Revenue - sending messages based on an integer custom attribute for “Total Revenue”:

total revenue

In this example, if a customer’s “Total Revenue” custom attribute is greater than zero, they will get the message:

1
We appreciate your business! Use our coupon SAVE10 for an extra 10% off your next purchase.

If a customer’s “Total Revenue” custom attribute does not exist or is equal to 0, they will get the following message:

1
Make your first purchase today! Use our coupon SAVE10 for an extra 10% off

Games Attended - sending messages that differ based on an integer attribute, “Number Games Attended”:

games liquid

In this example, if you have attended one game, you get the following message:

1
Loved that sport game? Get 10% off your second one with code SAVE10

If you have attended more than one game, you get:

1
Love sports games? Get 10% your next one with code SAVE10

If you haven’t attended any games, or that custom attribute doesn’t exist on your profile, you’d get the following message:

1
Attend your first game! 10% off with code SAVE10
WAS THIS PAGE HELPFUL?