Skip to Content
Variable SystemConditions

Conditions

Conditions are the logic layer that connects variables to behavior. They control which page a visitor navigates to, when a component is visible, which styles are active, and what property values apply. Conditions appear in four places throughout AppFunnel:

  • Routing — determine which page to navigate to next
  • Dynamic Properties — conditionally override any property value
  • Active Style — trigger the active visual state on a component
  • Visibility — show or hide components based on variable values

How Conditions Work

A condition compares a variable’s current value against a target using an operator:

variable operator value ───────── ───────── ───── answers.experience equals "advanced"

When the condition evaluates to true, the associated behavior triggers (navigate to a page, apply a style, show a component, etc.).

Operators

AppFunnel provides 12 condition operators. The operators available for a given variable depend on its type.

Full Operator Reference

OperatorDescriptionExample
equalsExact match (loose equality)answers.goal equals "profit"
notEqualsDoes not matchanswers.goal notEquals "profit"
containsString includes substringuser.email contains "@gmail"
notContainsString does not include substringuser.email notContains "@test"
greaterThanNumeric greater-thananswers.budget greaterThan 100
lessThanNumeric less-thanpage.timeOnCurrent lessThan 60
existsValue is not null, undefined, or empty stringuser.email exists
notExistsValue is null, undefined, or empty stringuser.email notExists
includesArray contains a specific valueanswers.interests includes "electronics"
notIncludesArray does not contain a specific valueanswers.interests notIncludes "clothing"
isEmptyString is blank or array has no itemsanswers.interests isEmpty
isNotEmptyString is non-blank or array has itemsanswers.interests isNotEmpty

Operators by Variable Type

Not all operators apply to every variable type. Here is which operators are available for each type:

TypeAvailable Operators
stringequals, notEquals, contains, notContains, exists, notExists, isEmpty
numberequals, notEquals, greaterThan, lessThan, exists, notExists
booleanequals, notEquals, exists, notExists
stringArrayincludes, notIncludes, equals, notEquals, greaterThan, lessThan, isEmpty, isNotEmpty, exists, notExists

For stringArray variables, equals, notEquals, greaterThan, and lessThan compare against the array length, not the array contents. Use includes to check if a specific value is in the array.


Condition Groups

Multiple conditions can be combined into groups using AND or OR logic.

AND Groups

All conditions must be true for the group to match:

AND: answers.experience equals "advanced" answers.budget greaterThan 500 answers.goal equals "profit"

This matches only when the visitor is experienced, has a budget over 500, and their goal is profit.

OR Groups

At least one condition must be true for the group to match:

OR: answers.experience equals "advanced" answers.experience equals "intermediate"

This matches when the visitor has either advanced or intermediate experience.

Nested Groups

Groups can be nested for complex logic:

AND: answers.goal equals "profit" OR: answers.experience equals "advanced" answers.budget greaterThan 1000

This matches when the goal is profit and the visitor is either advanced or has a high budget.


Where Conditions Are Used

Conditions drive behavior across AppFunnel:

  • Routing — Determine which page to navigate to next. Routes are evaluated top to bottom; first match wins.
  • Dynamic Properties — Conditionally override any property value (visibility, text, colors, click actions).
  • Active Style — Toggle a component’s visual state based on a single condition.

Liquid Expressions in Conditions

For advanced logic, conditions support Liquid expressions as the left-hand value. Instead of referencing a variable directly, you write a Liquid template that computes the value to compare.

This is powerful when you need to evaluate computed values or combine multiple variables.

Example: Compare computed value

Expression:

{{ products.yearly.rawPrice | divided_by: 12 | round: 2 }}

Operator: lessThan Value: 10

This condition is true when the yearly plan’s monthly equivalent is less than $10.

Example: Check combined string

Expression:

{{ answers.experience }}-{{ answers.goal }}

Operator: equals Value: advanced-profit

This condition matches a specific combination of two answers.

When a Liquid expression evaluates to a numeric string, it is automatically converted to a number for comparison. The expression {{ 5 | plus: 3 }} evaluates to the number 8, not the string "8".


Evaluation Behavior

Understanding how conditions evaluate edge cases helps you build reliable logic:

  • equals uses loose equality"42" equals 42 (string-number coercion).
  • exists checks for non-empty — a value “exists” when it is not null, not undefined, and not an empty string "". Note: 0 and false are considered to exist.
  • isEmpty on arrays checks .length === 0. On strings, it checks .trim() === "". On other types, it checks for falsiness.
  • contains is case-sensitive"Hello" does not contain "hello". If you need case-insensitive matching, use a Liquid expression with downcase.
  • Unknown operators always evaluate to false.
  • Empty condition groups (no rules) always evaluate to true.
Last updated on