Target Expression Reference

Last Updated: 12/8/2026     Tags: target expressions, target, expression, reference, purchased
  • Switch Version
  • V5
  • V4

Token Definitions

Token Description
field A subscriber field (e.g. firstname, email), a list option value, or a custom field key. The data type defaults to text, but can be cast to date, real or integer via field::date, field::real, or field::integer. Click here for more information on casting.
integer An integer/number (e.g. 1).
real A decimal number (e.g. 0.2).
percentage A percentage (e.g. 80%).
string A quoted string in single or double quotes (e.g. 'xxx').
null The database null value, (e.g. null).
range One of the options described in Date Ranges below.
count One of the options described in Counts below.
channel 'email', 'sms', 'whatsapp', 'web', 'displayad', 'line', or 'pushnotification'
event 'send'/'sent', 'click'/'clicked', 'open'/'opened', 'subscribe'/'subscribed', 'unsubscribe'/'unsubscribed', 'update'/'updated', 'forward'/'forwarded', 'reply'/'replied', 'view'/'viewed', 'enter'/'entered', 'refer'/'referred', 'convert'/'converted', 'bounce'/'bounced', 'like'/'liked', 'abandon'/'abandoned', 'submit'/'submitted', 'complain'/'complained', or 'control-group'

Field Predicate

Predicate Examples
[field] [operator] [integer|string|null] [range] state = 'VIC' would return subscribers whose state is VIC

postcode one of '2000, 2001, 2002, 2003' would return subscribers in postcodes 2000, 2001, 2002 and 2003

predicted_lifetime_value > 50 would return subscribers with a predicted lifetime value of more than $50

total_conversion_value < 100 would return subscribers with a total (past) conversion value of less than $100

List/Lists Predicate

Predicate Examples
subscribed list [integer] [range]
subscribed lists [integer] [range]
subscribed list 18 would return all subscribers who subscribed to list ID 18

subscribed lists 18, 22, 49 would return all subscribers who subscribed to list ID's 18, 22, 49
unsubscribed list [integer] [range]
unsubscribed lists [integer] [range]
unsubscribed lists 18, 22, 49 would return all subscribers who are unsubscribed from list ID's 18, 22, 49

unsubscribed lists 10, 20 this week would return subscribers who unsubscribed from list ID's 10 or 20 this week
subscribed list [integer] source [string] [range]
subscribed lists [integer] source [string] [range]
subscribed list 123 source "Website" would return subscribers who subscribed to list ID 123 with source "Website"
Predicate Examples
clicked link [string] [range]
clicked links [string] [range]
clicked link 'http://example.org/' would return all subscribers who clicked link 'http://example.org/'

clicked links 'http://example.org/1', 'http://example.org/2' would return subscribers who clicked link 'http://example.org/1' or link 'http://example.org/2'
clicked link starts with [string] [range]
clicked links starts with [string] [range]
clicked link starts with "http://example.org/products/" would return subscribers who clicked a link starting with that value
Predicate Examples
clicked link [string] activity [integer] [range] [count]
clicked links [string[, ...]] activity [integer] [range] [count]
clicked link 'http://example.com' activity 1 would return all subscribers who clicked link 'http://example.org/' within activity 1

clicked links 'http://example.com/1', 'http://example.com/2' activity 1 would return all subscribers who clicked links 'http://example.org/2' or 'http://example.org/2' within activity 1
clicked link [string] activities [integer] [range] [count]
clicked links [string[, ...]] activities [integer] [range] [count]
clicked link 'http://example.com' activities 1, 2 would return all subscribers who clicked link 'http://example.org/' within activities 1 or 2

clicked links 'http://example.com/1', 'http://example.com/2' activities 1, 2 would return all subscribers who clicked links 'http://example.org/1' or 'http://example.org/2' within activities 1 or 2

Activity/Activities Predicate

Predicate Examples
sent activity [integer] [range] [count]
sent activities [integer[, ...]] [range] [count]
sent activity 10 would return all subscribers who were sent activity ID 10

sent activities 10, 20 would return all subscribers who were sent activity ID 10 or activity ID 20
clicked activity [integer] [range] [count]
clicked activities [integer[, ...]] [range] [count]
clicked activity 20 would return all subscribers who clicked a link within activity ID 20

clicked activities 10, 20 would return all subscribers who clicked a link within activity ID 10 or activity ID 20
opened activity [integer] [range] [count]
opened activities [integer[, ...]] [range] [count]
opened activity 10 would return all subscribers who opened activity ID 10

opened activities 10, 20 would return all subscribers who opened activity ID 10 or activity ID 20
subscribed activity [integer] [range] [count]
subscribed activities [integer[, ...]] [range] [count]
subscribed activity 10 would return all subscribers who subscribed through activity ID 10 (e.g. a webform)

subscribed activities 10, 20 would return all subscribers who subscribed through activity ID 10 or activity ID 20 (e.g. a webform)
unsubscribed activity [integer] [range] [count]
unsubscribed activities [integer[, ...]] [range] [count]
unsubscribed activity 20 would return all subscribers who unsubscribed through activity ID 20 (e.g. a webform)

unsubscribed activities 10, 20 would return all subscribers who unsubscribed through activity ID 10 or activity ID 20 (e.g. a webform)
viewed activity [integer] [range] [count]
viewed activities [integer[, ...]] [range] [count]
viewed activity 10 would return all subscribers that have viewed activity ID 10 (useful for webforms)

viewed activities 10, 20 would return all subscribers that have viewed activity ID 10 or activity ID 20 (e.g. a webform)
bounced activity [integer] [range] [count]
bounced activities [integer[, ...]] [range] [count]
bounced activity 10 would return all subscribers who bounced from activity ID 10

bounced activities 10, 20 would return all subscribers who bounced from activity ID 10 or activity ID 20
converted activity [integer] [range] [count]
converted activities [integer[, ...]] [range] [count]
converted activity 10 would return all subscribers who converted/purchased through activity ID 10

converted activities 10, 20 would return all subscribers who converted/purchased through activity ID 10 or activity ID 20
liked activity [integer] [range] [count]
liked activities [integer[, ...]] [range] [count]
liked activity 10 would return all subscribers who liked (using a social media button) in activity ID 10

liked activities 10, 20 would return all subscribers who liked (using a social media button) in activity ID 10 or activity ID 20

Campaign/Campaigns Predicate

Predicate Examples
sent campaign [integer] [range] [count]
sent campaigns [integer[, ...]] [range] [count]
sent campaign 10 would return all subscribers who were sent activities within campaign ID 10

sent campaigns 10, 20 would return all subscribers who were sent activities within campaign ID 10 or campaign ID 20
clicked campaign [integer] [range] [count]
clicked campaigns [integer[, ...]] [range] [count]
clicked campaign 10 would return all subscribers who clicked links in activities within campaign ID 10

clicked campaigns 10, 20 would return all subscribers who clicked links in activities within campaign ID 10 or campaign ID 20
opened campaign [integer] [range] [count]
opened campaigns [integer[, ...]] [range] [count]
opened campaign 10 would return all subscribers who opened campaign ID 10

opened campaigns 10, 20 would return all subscribers who opened campaign ID 10 or campaign ID 20
subscribed campaign [integer] [range] [count]
subscribed campaigns [integer[, ...]] [range] [count]
subscribed campaign 10 would return all subscribers who subscribed using an activity within campaign ID 10 (e.g. a webform)

subscribed campaigns 10, 20 would return all subscribers who subscribed using an activity within campaigns ID 10 or ID 20 (e.g. a webform)
unsubscribed campaign [integer] [range] [count]
unsubscribed campaigns [integer[, ...]] [range] [count]
unsubscribed campaign 10 would return all subscribers who unsubscribed using an activity within campaign ID 10 (e.g. a webform)

unsubscribed campaigns 10, 20 would return all subscribers who unsubscribed using an activity within campaigns ID 10 or ID 20 (e.g. a webform)
viewed campaign [integer] [range] [count]
viewed campaigns [integer[, ...]] [range] [count]
viewed campaign 10 would return all subscribers who viewed an activity within campaign ID 10 (e.g. a webform)

viewed campaigns 10, 20 would return all subscribers who viewed an activity within campaigns ID 10 or ID 20 (e.g. a webform)
bounced campaign [integer] [range] [count]
bounced campaigns [integer[, ...]] [range] [count]
bounced campaign 10 would return all subscribers who bounced from an activity within campaign ID 10

bounced campaigns 10, 20 would return all subscribers who bounced from an activity within campaigns ID 10 or ID 20
converted campaign [integer] [range] [count]
converted campaigns [integer[, ...]] [range] [count]
converted campaign 10 would return all subscribers who converted/purchased through an activity within campaign ID 10

converted campaigns 10, 20 would return all subscribers who converted/purchased through an activity within campaigns ID 10 or ID 20
liked campaign [integer] [range] [count]
liked campaigns [integer[, ...]] [range] [count]
liked campaign 10 last 30 days would return all subscribers who liked (using a social media button) within campaign 10 in the last 30 days

liked campaigns 10, 20 last 30 days would return all subscribers who liked (using a social media button) within campaigns 10 or 20 in the last 30 days

Any Predicate

Predicate Examples
sent any [range] [count] sent any last 30 days would return all subscribers who were sent any activities in the last 30 days
opened any [range] [count] opened any 2-3 days ago would return all subscribers who opened any activity 2 to 3 days ago
clicked any [range] [count] clicked any count>5 would return all subscribers who clicked links more than 5 times
subscribed any [range] [count] subscribed any last 30 days would return all subscribers who subscribed through any activity (e.g. a webform) in the last 30 days
unsubscribed any [range] [count] unsubscribed any last 30 days would return all subscribers who unsubscribed through any activity (e.g. a webform) in the last 30 days
viewed any [range] [count] viewed any last 30 days would return all subscribers who viewed any activity (e.g. a webform) in the last 30 days
bounced any [range] [count] bounced any last 30 days would return all subscribers who bounced from any activity in the last 30 days
converted any [range] [count] converted any last 30 days would return all subscribers who converted through any activity in the last 30 days
liked any [range] [count] liked any last 30 days would return all subscribers who liked using the social media share buttons in any activity in the last 30 days
updated any [range] [count] updated any last 30 days would return all subscribers with tracked update events in the last 30 days
forwarded any [range] [count] forwarded any last 30 days would return all subscribers who forwarded any activity in the last 30 days
replied any [range] [count] replied any last 30 days would return all subscribers who replied to any activity in the last 30 days
entered any [range] [count] entered any last 30 days would return all subscribers who entered any tracked experience in the last 30 days
referred any [range] [count] referred any last 30 days would return all subscribers who referred in the last 30 days
abandoned any [range] [count] abandoned any all time would return all subscribers who abandoned at any point in time
complained any [range] [count] complained any last 30 days would return all subscribers who submitted any complaint in the last 30 days
control-group any [range] [count] control-group any all time would return all subscribers included in the control group at any point in time

Cluster Keyword Predicate

Predicate Examples
cluster_id [operator] [integer] cluster_id = 20 would return all subscribers that are assigned to cluster ID 20

cluster_id one of '20, 30, 40' would return all subscribers that are assigned to cluster ID's 20, 30 and 40

The cluster ID is a numerical value assigned to clusters. Do not use the cluster name. The cluster ID can be found under Settings > Clusters.

Views Predicate

Predicate Examples
match views [integer[, ...]] [string] match views 5, 10 would return all subscribers who match either of view IDs 5 or 10

match views 1 with "example" would return all subscribers who match view ID 1 when called with the parameter "example"

Purchase History Predicate

Predicate Examples
purchased [fields] [range] [count] purchased last 12 months would return all subscribers who have purchased in the last 12 months

purchased count>=5 would return all subscribers who have purchased at least 5 times

purchased id = "50" would return all subscribers who purchased product ID 50

purchased total::real > 100.0 last 12 months would return all subscribers who made a purchase with a total exceeding 100 in the last 12 months

purchased category like "Appliances/%" would return all subscribers who purchased a product with a "category" custom field value starting with "Applicances/"

purchased category like "Toys/%", price::real > 15.0 last 7 days would return all subscribers who purchased a product with a "category" custom field value starting with "Toys/" and a price above 15 any time in the last 7 days

purchased 2024-04-13 to 2024-04-16 would return all subscribers who made a purchase between April 13, 2024, at 12:00 PM and April 16, 2024, at 12:00 PM.

Visit Predicate

Predicate Examples
visited [fields] [range] [count] visited last 12 months would return all subscribers who have visited a tracked web page in the last 12 months

visited count>=2 would return all subscribers who have visited a tracked web page at least twice

visited url = "http://example.com" would return all subscribers who have visited http://example.com

visited url like "http://example.com/sales/%" last 12 months would return all subscribers who visited a page in the /sales/ directory in the last 12 months

Custom Tracking Predicate

Predicate Examples
tracked [event] [fields] [range] [count] tracked view last 12 months would return all subscribers who have had a "view" event logged in the last 12 months

tracked open count>=2 would return all subscribers who have had an open event logged at least twice

tracked update UserType = "premium" would return all subscribers who have had an update event logged with a "UserType" data field value of "premium"

tracked open AppPage like "products/%" last 12 months would return all subscribers who had an open event logged in the last 12 months containing an "AppPage" data field value starting with "products/"

tracked abandon all time would return all subscribers who have had an abandon event logged at any point in time

Birthday Predicate

Predicate Examples
birthday [range] birthday this month would return all subscribers with a birthday in the current month

birthday in 2-3 days would return all subscribers with a birthday in 2 to 3 days

Contactable Predicate

Predicate Examples
contactable via [channel] contactable via email would return all subscribers with a valid email address who are not globally unsubscribed

contactable via sms would return all subscribers with a valid phone number who are not globally unsubscribed

Complained Predicate

Predicate Examples
complained [channel] [range] complained email would return all subscribers who have submitted a spam complaint via email

complained sms would return all subscribers who have submitted a spam complaint via SMS

complained email last 30 days would return all subscribers who submitted a spam complaint via email in the last 30 days

Event Predicate Syntax

Use these forms for event predicates to avoid duplicating separate activity/campaign/revision/configuration/asset tables:

  • [event] any [range] [count]
  • [event] activity|activities [ID, ...] [range] [count]
  • [event] campaign|campaigns [ID, ...] [range] [count]
  • [event] revision|revisions [ID, ...] [range] [count]
  • [event] configuration|configurations [ID, ...] [range] [count]
  • [event] asset|assets [ID, ...] [range] [count]
  • [event] [activity type] [range] [count]

Supported activity type values include email, sms, whatsapp, web, displayad, line, and pushnotification.

For example, sent email last 30 days is valid and targets subscribers sent email activities in the last 30 days.

Resource-history vs tracked predicates

  • Resource-history predicates (for example opened campaign 10 last 30 days) evaluate interaction history tied to Taguchi resources (activities, campaigns, revisions, configurations, assets, or activity type).
  • tracked ... predicates (for example tracked open AppPage like "products/%" last 30 days) evaluate custom tracked events and event payload fields.
  • Use resource-history forms when filtering on messaging/resource IDs; use tracked forms when filtering on custom event fields.

Audience Predicate

Predicate Examples
in audience [integer]
in audiences [integer]
in audience 123 would return subscribers in audience ID 123

in audiences 123, 456 would return subscribers in audience ID 123 or 456
joined audience [integer] [range]
joined audiences [integer] [range]
joined audience 123 last 30 days would return subscribers who joined audience ID 123 in the last 30 days
left audience [integer] [range]
left audiences [integer] [range]
left audiences 123, 456 last 30 days would return subscribers who left audience ID 123 or 456 in the last 30 days

Channel Engagement Predicate

Predicate Examples
channel [channel] [event] [range] channel email opened last 30 days would return subscribers who opened via email in the last 30 days
channel [channel] [event] [count] channel email opened count>5 would return subscribers who opened via email more than 5 times
channel [channel] [event] rate [operator] [real] channel email opened rate>0.2 would return subscribers whose email open rate is greater than 0.2

Supported channel event keywords are send, clicked, opened, viewed, replied, converted, and subscribed.

Partition Predicate

Predicate Examples
partition by [field] partition by country groups matching subscribers by country
partition [field] [operator] [integer|string] partition id > 0 filters subscribers to rows where partition field criteria are met
per partition [field] most recently purchased per partition country most recently purchased ranks subscribers by most recent purchase within each country
per partition [field] most recently engaged per partition country most recently engaged ranks subscribers by most recent engagement within each country

Subset Selection Definitions

Selection Definition
All Subscribers Selects all subscribers that match a set of conditions.
Random N Subscribers Selects a random N amount of subscribers who match a set of conditions. Where N is defined as a number or percentage of the total.
Highest-value N subscribers Returns N amount of subscribers who are in the top 10% of subscribers as measured by the highest total conversion value. Where N is defined as a number or percentage of the total.
Lowest-value N subscribers Returns N amount of subscribers who are in the bottom 10% of subscribers as measured by the highest total conversion value. Where N is defined as a number or percentage of the total.
Highest predicted value N subscribers Returns N amount of subscribers with the highest predicted value. Where N is defined as a number or percentage of the total.
Lowest predicted value N subscribers Returns N amount of subscribers with the lowest predicted value. Where N is defined as a number or percentage of the total.
Most-engaged N subscribers Returns N amount of subscribers who have interacted the most, as measured by engagement clicks (clicks, opens and web activity) based on all past activities. Where N is defined as a number or percentage of the total.
Least-engaged N subscribers Returns N amount of subscribers who have interacted the least, as measured by engagement clicks (clicks, opens and web activity) based on all past activities. Where N is defined as a number or percentage of the total.
N subscribers who most recently engaged Returns N amount of subscribers who have interacted most recently, as measured by engagement clicks (clicks, opens and web activity). Where N is defined as a number or percentage of the total.
N subscribers who most recently purchased Returns N amount of subscribers who have purchased most recently. Where N is defined as a number or percentage of the total.
N subscribers who most frequently engaged Returns N amount of subscribers who have engaged most frequently. Where N is defined as a number or percentage of the total.
N subscribers who most frequently purchased Returns N amount of subscribers who have purchased most frequently. Where N is defined as a number or percentage of the total.

Date Ranges

Date Predicate Description
yesterday 00:00:00 yesterday to 00:00:00 today
today 00:00:00 today to 00:00:00 tomorrow
tomorrow 00:00:00 tomorrow to 00:00:00 the following day
this week 00:00:00 last Sunday to 00:00:00 next Sunday
this month 00:00:00 on the 1st of the current month to 00:00:00 on the 1st of the next month
this year 00:00:00 Jan 1st this year to 00:00:00 Jan 1st next year
last week 00:00:00 preceding Sunday to 00:00:00 last Sunday
last month 00:00:00 on the 1st of the last month to 00:00:00 on the 1st of the current month
last year 00:00:00 on Jan 1st last year to 00:00:00 on Jan 1st this year
next N hours current datetime to (current datetime + N hours)
next N days current datetime to (current datetime + N days)
next minute current datetime to (current datetime + 1 minute)
next N minutes current datetime to (current datetime + N minutes)
in N days current datetime to (current datetime + N days)
in N-N days range between N and N days in the future
in N-N minutes range between N and N minutes in the future
next N weeks current datetime to (current datetime + N weeks)
next N months current datetime to (current datetime + N months)
next N years current datetime to (current datetime + N years)
last minute (current datetime - 1 minute) to the current datetime
last N minutes (current datetime - N minutes) to the current datetime
last N hours (current datetime - N hours) to the current datetime
last N days (current datetime - N days) to the current datetime
last N weeks (current datetime - N weeks) to the current datetime
last N months (current datetime - N months) to the current datetime
last N years (current datetime - N years) to the current datetime
N hour[s] ago timestamp rounded down to the hour between (current datetime - N hours) and (current datetime - (N - 1) hours)
N minute[s] ago timestamp rounded down to the minute between (current datetime - N minutes) and (current datetime - (N - 1) minutes)
N-N minute[s] ago range between N and N minutes ago
N day[s] ago timestamp rounded down to the day between (current datetime - N days) and (current datetime - (N - 1) days)
N-N day[s] ago range between N and N days ago
N week[s] ago timestamp rounded down to the day between (current datetime - N weeks) and (current datetime - N weeks + 1 day)
N month[s] ago timestamp rounded down to the day between (current datetime - N months) and (current datetime - N months + 1 day)
N year[s] ago timestamp rounded down to the day between (current datetime - N years) and (current datetime - N years + 1 day).
Can be used for targeting recipients having a specific age
all time no time constraints (from the earliest available time to the current datetime); can also be omitted
YYYY-MM-DD to YYYY-MM-DD 00:00:00 on the first date to 00:00:00 on the second date

For queries on known future events, e.g. birthdays, next can be used in place of last in any of the above expressions.

Counts

Predicate Examples
count [operator] [integer] purchased count>5 would return subscribers with more than 5 past purchases.

opened any count<=2 would return subscribers who have opened less than or equal to two times.

Limit/Random Models

Predicate Examples
limit [integer|percentage] limit 10 selects 10 random subscribers matched by the previous expression
random [integer|percentage] random 50% selects a random 50% of the subscribers matched by the previous expression
highest value [integer|percentage] highest value 10% selects the top 10% of subscribers as measured by highest total conversion value
lowest value [integer|percentage] lowest value 10% selects the bottom 10% of subscribers as measured by highest total conversion value
highest future value [integer|percentage] highest future value 50 selects the 50 subscribers with the highest predicted future value
lowest future value [integer|percentage] lowest future value 50 selects the 50 subscribers with the lowest predicted future value
most engaged [integer|percentage] most engaged 50% selects the top 50% of subscribers as measured by engagement (clicks, opens, web activity)
least engaged [integer|percentage] least engaged 50% selects the bottom 50% of subscribers as measured by engagement (clicks, opens, web activity)
most recently purchased [integer|percentage] most recently purchased 100 selects the 100 subscribers who purchased most recently
most recently engaged [integer|percentage] most recently engaged 100 selects the 100 subscribers who engaged most recently
most frequently purchased [integer|percentage] most frequently purchased 10% selects the top 10% of subscribers by purchase frequency
most frequently engaged [integer|percentage] most frequently engaged 10% selects the top 10% of subscribers by engagement frequency
random|highest value|lowest value|most engaged|least engaged|most recently purchased|most recently engaged|most frequently purchased|most frequently engaged per partition [integer|percentage] (opened any) random per partition 10% selects a random 10% from each partition; the same form applies to value and engagement ranking models

Comparison Operators

Assume variable a holds a value of 7 and variable b holds a value of 3.

Operator Description Example
= Equal to. Checks if the values either side of the operator are equal or not, if yes then condition becomes true. (a = b) is false, (a = a) is true.
!= Not Equal to. Checks if the values either side of the operator are not equal, if yes then condition becomes true. (a != b) is true, (b != b) is false.
> Greater than. Checks if the value to the left of the operator is larger than the right. If yes, the condition becomes true. (a > b) is true, (b > a) is false.
< Less than. Checks if the value to the left of the operator is smaller than the right. If yes, the condition becomes true. (a < b) is false, (b < a) is true.
>= Greater than or equal to. Checks if the value to the left of the operator is larger or equal to the right. If yes, the condition becomes true. (a >= b) is true, (a >= 4) is true.
<= Less than or equal to. Checks if the value to the left of the operator is smaller or equal to the right. If yes, the condition becomes true. (a <= b) is false, (b <= a) is true.

Binary Operators

Operator Description Example
and or && The operator executes both predicates if all the conditions separated by AND or && are TRUE. subscribed list 10 and opened campaign 20 would return all subscribers who subscribed to list 10 and opened campaign 20
or or || The operator executes one of the predicates if one of the conditions separated by OR or || are TRUE. subscribed list 10 or opened campaign 20 would return all subscribers who subscribed to list 10 or opened campaign 20
intersect or & Returns only subscribers common to both sides of the expression. opened any last 30 days intersect clicked any last 30 days returns subscribers who both opened and clicked in the last 30 days
union or | Returns subscribers from either side of the expression. opened any last 30 days union clicked any last 30 days returns subscribers who opened or clicked in the last 30 days
except or - Removes subscribers on the right side from those on the left side. opened any last 30 days except clicked any last 30 days returns subscribers who opened but did not click in the last 30 days

Boolean expressions are evaluated left-to-right. Use parentheses whenever mixing and, or, and except.

Unary Operators

Operator Description Example
not or ! or ~ Negates an operator ~ subscribed list 10 would return subscribers who have not subscribed to list 10

Logical Operators

Assume variable state equals Victoria

Operator Description Example
like This is used to compare a value to similar values using wildcard operators. state LIKE 'Vic%' is true
not like This reverses the meaning of the like operator. state NOT LIKE 'Vic%' is false
ilike Case insensitive value comparison, similar to the like operator. state ILIKE 'vic%' is true
not ilike Case insensitive value comparison, similar to the not like operator. state NOT ILIKE 'vic%' is false
is Evaluates to true if the variables on either side of the operator point to the same object and false otherwise. state IS 'VIC' is false
is not Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. state IS NOT 'VIC' is true
one of Returns true if variable on the left of operator is within the comma separated variable to the right of the operator. state ONE OF 'Victoria, Queensland' is true
not one of Returns false if variable on the left of operator is within the comma separated variable to the right of the operator. state NOT ONE OF 'Victoria, Queensland' is false
@@ Field comparison operator for matching values between two fields. email_domain @@ company_domain is true when both fields are equal
!@@ Negated field comparison operator for values that do not match between two fields. email_domain !@@ company_domain is true when fields are different

ILIKE operator examples

Use case: This matches subscribers whose email ends with or has an email domain of @gmail.com:
email ilike "%@gmail.com"

Use case: This matches subscribers whose country is in New Zealand or NZ and those with the same country but the value is all lower-cased (new zealand or nz):
country ilike "%N%Z%"

Casting

Casting a data type to a specific type.

Operator Description
::real This casting type handles any kind of number, including both whole numbers (integers) and decimal numbers (floats). It allows for a wide range of numerical values, both positive and negative, with or without fractional parts. The format to cast is field::real.
::integer This casting type specifically handles only whole numbers, without any fractional parts or decimals. It is used when you need to work exclusively with integers that cannot be divided into parts. The format to cast is field::integer.
::date This casting type converts a value into a date type. It is used when you need to work with dates, such as representing calendar dates, scheduling events, or calculating durations between different points in time. The format to cast is field::date.

POSIX Regular Expression Operators

More information on POSIX Regular Expressions. Use the following link for testing your regular expressions: - <a href="https://regexr.com/85sbm"

Operator Description
~ Matches regular expression, case sensitive
!~ Does not match regular expression, case sensitive
~* Matches regular expression, case insensitive
!~* Does not match regular expression, case insensitive

Sample regex usages

Use case: This matches phone numbers that:

  • Begin with a + sign.
  • Contain only digits after the + sign.
  • Contain a maximum of 15 digits.
    phone ~ '^\\\\+\\\\d{1,15}$'
    

Use case: This will match phone numbers that contain exactly 12 digits.

'cf:custom field' ~ "^\\\\d{12}$"

Use case: This matches email addresses in the format username@domain.com:

  • Contains letters, numbers, and allowed symbols before the @.
  • Contains a domain after the @ symbol.
    email ~ "^\\\\w+@\\\\w+\\\\.\\\\w+$"
    

Use case: This matches dates in the format DD/MM/YYYY:

  • Day: two digits.
  • Month: two digits.
  • Year: four digits.
    date ~ "^\\\\d{2}/\\\\d{2}/\\\\d{4}$"
    

The double backslashes (\\) are used to escape the backslashes properly, as regex in some systems requires additional escaping to handle special characters like the + sign and digit matching.

Audiences in Target Expressions

Audiences can be used inside target expressions as a reusable way to group subscribers. Instead of rebuilding the same targeting rules each time, you can reference an audience that already defines who should be included. Audiences are updated daily, helping keep targeting accurate and easier to manage.

To learn more about creating and managing audiences, see the Knowledge Base article on Audiences.