Skip to content

Condition

The Condition component adds logic to your application by executing actions only when specific criteria are met. Use it to customize user paths, validate inputs, control navigation, or create dynamic experiences based on user data.

A single Condition component can manage multiple independent conditions. Each condition evaluates one or more expressions and triggers actions when the criteria are satisfied.

Common use cases:

  • Show premium content only to subscribed users
  • Display different screens based on quiz scores
  • Validate form inputs before allowing submission
  • Adapt content based on device orientation or time of day

Create a condition

Step 1: Add the component

Click on Components and insert a Condition component.

  • For screen-specific logic, add it to that screen
  • For application-wide logic, add it at the Project level

The Condition component is non-graphical and appears in the Objects list.

Step 2: Create a new condition

In the component properties, click + Add to create a new condition. Give it a clear, descriptive name.

This name appears throughout the interface when referencing your condition in triggers and actions. Choose a name that clearly describes what the condition checks.

condition component example

Step 3: Add expressions

Each condition evaluates one or more expressions. Click + Add expression to define the criteria that must be met.

Combining multiple expressions

When your condition has multiple expressions, you can choose how they should be evaluated together using AND / OR logic:

  • AND: All expressions must be true for the condition to be met
  • OR: At least one expression must be true for the condition to be met

This selector appears automatically when you add more than one expression to your condition.

Example with AND logic:

  • Expression 1: Score > 100
  • Expression 2: Time < 60
  • Logic: AND
  • Result: Condition is true only when score is greater than 100 AND time is less than 60

Example with OR logic:

  • Expression 1: User level = “premium”
  • Expression 2: User level = “admin”
  • Logic: OR
  • Result: Condition is true when user is either premium OR admin

Composing an expression

Each individual expression is composed in three parts:

  1. Data source: Select what to evaluate (variable, component value, etc.)
  2. Function: Choose how to test the data (equals, greater than, contains, etc.)
  3. Value: Specify what to compare against (when applicable)

Using conditions as data sources

Instead of selecting a variable or component value, you can reference another condition as your data source. This enables powerful composition patterns.

How it works:

When you select a condition as your data source, you can use the True or False functions to test whether that condition is currently met.

Common use cases:

  1. Inverse logic - Easily create the opposite of an existing condition without rewriting all expressions:

    • Condition “User is premium” exists
    • Create “User is NOT premium” by selecting that condition with the False function
  2. Complex nested logic - Combine multiple conditions with different priorities (like parentheses in math):

    • Condition A: “High score” (score > 100 AND time < 60)
    • Condition B: “Premium user” (account type = “premium”)
    • Condition C: “Show bonus” = A is True OR B is True
  3. Reusable condition blocks - Define complex logic once and reference it multiple times:

    • Condition “User can edit” (is owner OR is admin OR is moderator)
    • Use this condition in multiple places without duplicating the expressions

Example:

Create a branching logic for a game:

  • Condition 1: “Can play advanced level” = (level > 5 AND has tutorial completed)
  • Condition 2: “Show advanced content” = “Can play advanced level” is True AND device orientation = “landscape”

This approach keeps conditions readable and maintainable as complexity grows.

Available functions

PandaSuite offers 18 condition functions organized by data type and use case. The available functions automatically adapt based on your selected data source type.

Comparison functions

These functions work with numbers, dates, and text to compare values.

FunctionDescriptionExample use case
Greater thanTests if source is greater than valueCheck if score > 100
Less thanTests if source is less than valueCheck if remaining lives < 3
Greater than or equal toTests if source is ≥ valueCheck if age ≥ 18
Less than or equal toTests if source is ≤ valueCheck if progress ≤ 50%
Equal toTests if source equals value exactlyCheck if answer = “correct”
Not equal toTests if source differs from valueCheck if status ≠ “pending”

For date comparisons, these functions compare timestamps numerically. A date closer to now is “greater than” a date in the past.

Boolean functions

These functions test true/false values and work with boolean data sources.

FunctionDescriptionExample use case
TrueTests if value is trueCheck if user is logged in
FalseTests if value is falseCheck if tutorial is not completed
Unknown or emptyTests if value is null, undefined, or emptyCheck if optional field is not filled

True and False are particularly useful when referencing another condition as a data source. Use False to easily create the inverse of an existing condition.

Text functions

These functions work specifically with text data.

FunctionDescriptionExample use case
Starts withTests if text begins with specific charactersCheck if email starts with “admin”
Ends withTests if text ends with specific charactersCheck if filename ends with “.pdf”
MatchTests if text matches a regular expression patternValidate phone number format

The Match function uses regular expressions. For example, the pattern ^[0-9]{5}$ matches exactly 5 digits, useful for validating zip codes.

Existence functions

These functions check whether data exists or has a value.

FunctionDescriptionDifference
UnknownTests if value is null or undefinedUse for checking if a variable has been initialized
Unknown or emptyTests if value is null, undefined, OR empty string/arrayUse for checking if user input or optional data is missing
KnownTests if value exists and is not emptyOpposite of “Unknown or empty” - confirms data is present

Unknown only checks for null/undefined, while Unknown or empty also considers empty strings (""), empty arrays ([]), and empty objects as “unknown”. Use Unknown or empty for form validation.

Collection functions

These functions work with arrays, collections, and multi-reference data.

FunctionDescriptionExample use case
ContainsTests if array/collection includes a specific item or if text contains a substringCheck if favorites list contains current item
Doesn’t containOpposite of ContainsCheck if user hasn’t already completed this level
EveryTests if every item in source array is contained in the value arrayCheck if user has collected all required items
SomeTests if at least one item in source array is contained in the value arrayCheck if user has any premium features

Every vs Some explained: Imagine a user who collected badges ["bronze", "silver"] and you want to check against required badges ["bronze", "silver", "gold"]. The Some function returns true because the user has at least one matching badge (bronze OR silver). The Every function also returns true because every badge the user collected exists in the required list. However, if you test against just ["bronze"], Some still returns true (user has bronze) but Every returns false (user has more than what’s being tested).

How conditions are evaluated

Once you’ve created your conditions, they need to be evaluated to test whether they’re true or false.

Automatic evaluation

Enable Automatic evaluation in the condition properties to have it run automatically whenever its data sources change.

For example, a condition checking “score > 100” will re-evaluate immediately when the score variable updates. This is ideal for real-time validation and dynamic UI updates.

Manual evaluation

To evaluate conditions on demand, use these actions from any trigger in your application:

ActionUse case
Interact with a component > Conditions > Evaluate conditionTrigger evaluation of a specific condition when an event occurs (button click, screen load, etc.)
Interact with a component > Conditions > Evaluate all conditionsEvaluate all conditions in the component at once

You can optionally add a delay before evaluation.

evaluation settings

Reacting to condition results

When conditions are evaluated, they fire triggers that you can use to execute actions.

Per-condition triggers

Each condition you create gets its own Evaluation trigger that fires when that specific condition becomes true. Use this to react to individual conditions.

To set up:

  1. Select your Condition component
  2. Add a new action
  3. Choose the trigger Evaluation: [your condition name]
  4. Add your action: navigate to a screen, show a pop-up, update data, etc.
trigger action example

Component-wide triggers

These triggers react to the overall state of all conditions in the component:

TriggerWhen it fires
Evaluate if all conditions are trueAll conditions in the component are true
Evaluate if at least one condition is trueOne or more conditions are true
Evaluation if none of all conditions is trueAll conditions are false

Use these when you need to react to the combined result of multiple conditions.

Example workflow:

A quiz application with branching logic:

  • Condition 1: “Passed” - Score ≥ 80

    • On Evaluation: Passed → Navigate to “Congratulations” screen
  • Condition 2: “Failed” - Score < 80

    • On Evaluation: Failed → Navigate to “Try Again” screen

This pattern keeps your logic clear and maintainable.