Writing targeting rules
Set targeting rules
After creating a flow, click on the start block to open the details pane. In the details pane you can set the expression for which users should qualify for this flow.
Learn more about start blocks →
Expression language
This is the expression language you can use to craft entry conditions:
Type of user property | Operators | Rules | Example |
---|---|---|---|
Number | == > >= < <= != | user.properties.projects_created <= 3 | |
Boolean | == != | Allowed values are only true and false (not T , F , etc.) | user.properties.activated == true |
String | == != | Strings must be surrounded by double quotes " . You can escape any double quote characters with \ . These are case sensitive: they must exactly match the property value. | user.properties.SKU == "Free" group.properties.name == "World’s \"Best\" Coffee" |
Logical group | AND OR | These are case insensitive: you can use OR , Or , or or | user.properties.role == "marketing" OR user.properties.role == "sales" |
Reserved words | The expression can’t contain:'DROP' 'TRUNCATE' 'DELETE' 'COMMIT' 'GRANT ALL' 'CREATE OR REPLACE' |
Property names are case sensitive and the property name in the expression must match the case of the user or group property. Projects
is different than projects
.
Accessing nested user and group properties are currently unsupported. You can access a top level property such as user.properties.email
, but not a nested property such as user.properties.sku.name
.
Example targeting rules
Let’s say a user and a group have the following properties:
user = {
identifier: "55c8-2a34",
properties: {
email: "oneill@acme.com",
name: "O'Neil",
activated: false,
projects: 2,
role: "Marketing",
},
groups: [
{
identifier: "ea83-47h1",
}
]
}
group = {
identifier: "ea83-47h1",
properties: {
email: "@acme.com",
name: "Acme Co",
total_projects: 42,
SKU: "Pro",
integration_setup: false,
}
}
Here are some example targeting rules and the result for this user:
Targeting rules | Result |
---|---|
user.properties.activated == false | ✅ User qualifies |
user.properties.projects < 10 AND group.properties.sku == "Pro" | ✅ User qualifies |
user.properties.role == "Marketing" OR user.properties.role == "Sales" | ✅ User qualifies |
user.properties.activated == true | ❌ User does not qualify |
group.properties.integration_setup == true | ❌ User does not qualify |
Flow qualification
A user’s qualification for a flow is evaluated in real-time. If the user hasn’t started the Flow and the user’s properties are updated where the user no longer matches the targeting rules, then they will no longer qualify for that flow and will not start it.
Once a user starts a flow the flow is in progress and the user will remain in that flow until the flow is finished or exited, even if the user’s properties are updated and no longer match the targeting rules.