
This can be translated to: "If Score is greater than 20 then go to this path. Otherwise, go to the other path."
Configuration Options
Comparison Setup
- Variable Selection: Choose which bot variable to evaluate
- Operator Selection: Select from 12 different comparison operators
- Value Input: Specify the comparison value (supports variables)
- Multiple Conditions: Add multiple comparisons with logical operators
Logical Operators
- AND: All comparisons must be true for the condition to pass
- OR: At least one comparison must be true for the condition to pass
- Mixed Logic: Combine multiple comparisons with consistent logical operators
- Evaluation Order: Comparisons are evaluated in the order they appear
Features
Comprehensive Comparison Operators
The condition block supports 12 different comparison types for maximum flexibility:Text Comparisons
- Equal to: Exact string matching (case-sensitive)
- Not equal: Inverse of equal comparison
- Contains: Checks if variable contains the specified value
- Does not contain: Inverse of contains comparison
- Starts with: Checks if variable begins with specified value
- Ends with: Checks if variable ends with specified value
Numeric Comparisons
- Greater than: Numeric comparison (greater than or equal to)
- Less than: Numeric comparison (less than or equal to)
Existence Checks
- Is set: Checks if variable has any value (not null, undefined, or empty string)
- Is empty: Checks if variable is null, undefined, or empty string
Pattern Matching
- Matches regex: Advanced pattern matching using regular expressions
- Does not match regex: Inverse of regex pattern matching
Advanced Variable Support
- Dynamic Values: Use variables in both sides of comparisons
- Type Flexibility: Handles strings, numbers, arrays, and boolean values
- Nested Conditions: Complex logical structures with multiple variables
- Real-time Evaluation: Conditions are evaluated dynamically during conversation
Operators
Equal to
Will match if the provided value is strictly equal to the value.
Not equal
Will match if the provided value is not equal to the value.
Contains
Will match if the provided value contains the value. If a list is provided, it will match if the
list has at least one element in common with the value.
Does not contain
Same as
Contains
but will match the inverse.Greater than
Will match if the provided value is greater or equal than the value.
Less than
Will match if the provided value is less or equal than the value.
Is set
Will match if the provided value is not null or undefined and not an empty string.
Is empty
Will match if the provided value is null, undefined, or an empty string.
Starts with
Will match if the provided value starts with the value.
Ends with
Will match if the provided value ends with the value.
Matches regex
Value should start and end with
/
and contain a valid regex pattern.Example:/^hello$/
will match if the string is strictly equal to “hello”./hello/
will match if the string contains “hello”. Like “hello world”./hello/i
will match if the string contains “hello” case-insensitive. Like “Hello world”./[0-9]+/
will match if the string contains one or more digits. Like “123”.
Does not match regex
Same as
Matches regex
but will match if the provided value does not match the regex pattern.Advanced Features
Complex Logical Structures
Build sophisticated decision trees with multiple conditions:Dynamic Condition Values
Use variables in comparison values for maximum flexibility:Array and List Handling
Handle complex data structures with contains operations:- Array Variables: Check if arrays contain specific values
- Comma-separated Lists: Search within concatenated strings
- Multiple Values: Use contains to match any item in a list
Regular Expression Power
Advanced pattern matching for complex validation:Best Practices
Condition Design
- Clear Logic: Keep conditions readable and maintainable
- Single Responsibility: Each condition should test one logical concept
- Meaningful Names: Use descriptive variable names that explain their purpose
- Documentation: Comment complex conditions for team understanding
Performance Optimization
- Order Matters: Place most likely true conditions first in OR logic
- Variable Efficiency: Avoid redundant variable lookups in multiple conditions
- Regex Complexity: Keep regular expressions simple when possible
- Condition Count: Limit the number of conditions per block for readability
User Experience
- Graceful Defaults: Always provide meaningful default paths
- Error Handling: Account for undefined or null variables
- Path Clarity: Make both true and false paths valuable to users
- Testing Coverage: Test all condition paths thoroughly
Variable Management
- Type Consistency: Ensure variables contain expected data types
- Validation: Validate variable content before complex comparisons
- Scope Awareness: Understand variable availability across different flows
- Default Values: Set appropriate default values for optional variables
Example Use Cases
User Segmentation
Dynamic Pricing
Content Personalization
Form Validation
Troubleshooting
Common Logic Errors
- Case Sensitivity: “Premium” ≠ “premium” - use exact case matching
- Type Mismatches: Comparing strings with numbers may not work as expected
- Empty Variables: Undefined variables may cause unexpected behavior
- Operator Confusion: “Greater than” includes equality, use appropriate operators
Variable-Related Issues
- Undefined Variables: Check that variables exist before comparison
- Array Handling: Use “Contains” operator for array values, not “Equal to”
- Dynamic Values: Ensure comparison value variables contain expected data
- Scope Problems: Variables may not be available in all conversation contexts
Regex Troubleshooting
- Syntax Errors: Validate regex patterns before deployment
- Escape Characters: Properly escape special characters in patterns
- Performance: Complex regex can slow down condition evaluation
- Testing: Use regex testing tools to verify patterns work as expected
Flow Logic Problems
- Dead Ends: Ensure both condition paths lead to meaningful destinations
- Infinite Loops: Avoid conditions that could create circular flows
- Path Coverage: Test all possible condition outcomes
- Default Handling: Provide fallback behavior for edge cases
Platform-Specific Considerations
- Mobile Compatibility: Test conditions across different devices
- Browser Differences: Some regex patterns may behave differently
- Network Issues: Handle cases where variable updates may be delayed
- Internationalization: Consider locale-specific formatting in comparisons