> For the complete documentation index, see [llms.txt](https://help.blings.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.blings.io/app/workflows-branching-logic/advanced-conditions.md).

# Advanced Conditions

Advanced conditions let you create sophisticated branching logic by combining multiple criteria. Use AND/OR operators to build complex decision trees that respond to multiple data points.

## AND/OR Logic

### AND Conditions (All Must Be True)

Use AND when you want ALL conditions to be met before taking a specific path.

**Example:**

```
IF user_type = "VIP" AND location = "US" AND purchase_count > 5
THEN show exclusive VIP offer
```

### OR Conditions (Any Can Be True)

Use OR when you want to take a path if ANY of the conditions are met.

**Example:**

```
IF user_type = "VIP" OR total_spent > $1000 OR subscription_length > 12_months
THEN show premium features
```

## Complex Decision Trees

### Multi-Level Branching

Create sophisticated flows that consider multiple factors:

```
Start → Check User Type
    ├─ New Customer → Check Location
    │   ├─ US → Show US welcome
    │   └─ International → Show global welcome
    │
    └─ Returning Customer → Check Purchase History
        ├─ High Value (AND: spent > $500, purchases > 3) → VIP treatment
        ├─ Medium Value (AND: spent > $100, purchases > 1) → Loyalty rewards
        └─ Low Value → Re-engagement campaign
```

### Conditional Scoring

Combine multiple data points to create scores or categories:

```
Score = 0
IF user_type = "VIP" THEN Score += 10
IF location = "US" THEN Score += 5
IF purchase_count > 5 THEN Score += 10
IF last_purchase < 30_days THEN Score += 5

IF Score >= 20 THEN show exclusive offer
IF Score >= 10 THEN show standard offer
ELSE show re-engagement
```

## Real-World Examples

### E-commerce Personalization

```
IF (product_category = "electronics" AND budget > $500) OR (user_type = "tech_enthusiast")
THEN show premium electronics
ELSE show budget-friendly options
```

### SaaS Onboarding

```
IF (company_size = "enterprise" AND role = "decision_maker") AND (trial_days > 7)
THEN show enterprise demo
ELSE IF (company_size = "startup" OR role = "individual")
THEN show self-service setup
```

## Best Practices

* **Start simple** — Build complex logic step by step
* **Test thoroughly** — Preview all possible combinations
* **Document your logic** — Keep notes on complex decision trees
* **Use clear naming** — Name variables and conditions descriptively
* **Plan for edge cases** — Always include fallback paths

## Common Pitfalls

* **Over-complicating** — Don't add complexity unless it adds value
* **Circular logic** — Avoid conditions that reference themselves
* **Missing defaults** — Always have a path for unexpected scenarios
* **Poor performance** — Complex conditions can slow down video loading

***

**Ready to build quizzes?** Learn how to create [interactive quizzes with scoring](/app/workflows-branching-logic/quizzes-scoring.md).
