# 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](/workflows-branching-logic/quizzes-scoring.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.blings.io/workflows-branching-logic/advanced-conditions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
