> For the complete documentation index, see [llms.txt](https://docs.ownchat.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ownchat.app/bot/utility/if-statement-adv.md).

# IF Statement Adv

The **IF Statement Adv** action allows chatbot builders to create **advanced conditional logic workflows** using multiple conditions, logical operators, and comparison rules.

Unlike the standard IF Statement, the advanced version supports more flexible and complex condition configurations such as:

* Multiple AND/OR conditions
* Numeric comparisons
* Dynamic and static values
* Advanced workflow branching

This utility action helps businesses automate decision-making processes inside chatbot workflows based on customer inputs, payment status, order details, purchase values, and other variables.

The walkthrough demonstrates configuring advanced payment and order validation logic using multiple conditions, operators, and automated response actions.

{% embed url="<https://app.supademo.com/demo/cmmvmau9b18xzen0y8dxtqkvy?utm_source=link>" %}

### When to Use IF Statement Adv &#x20;

Use the **IF Statement Adv** action when your chatbot requires **complex conditional logic** involving multiple variables or advanced comparisons.

#### Common Use Cases &#x20;

* Payment validation workflows
* Order eligibility checks
* Purchase amount verification
* Lead qualification logic
* Customer segmentation
* Multi-condition chatbot automation

**Example Interaction** &#x20;

Condition 1:\
Payment = Successful\
\
AND\
\
Condition 2:\
Last Purchase Amount > 1000

If both conditions are true, the chatbot triggers the success workflow automatically.

### How to Add IF Statement Adv &#x20;

Follow these steps to add the **IF Statement Adv** action to your bot workflow.

1. Open **Bot Builder**
2. Click the **Add Node** button
3. Open the **Utilities** tab
4. Select **IF Statement Adv**
5. Configure the condition settings
6. Add multiple conditions if required
7. Configure Success and Fail actions
8. Click **Create**
9. Click **Publish** to deploy the workflow

The walkthrough demonstrates selecting the IF Statement Adv node from the Utilities section.

### Accessing the Utilities Section &#x20;

To access the IF Statement Adv action:

1. Click **Add Node**<br>

{% embed url="<https://app.supademo.com/demo/cmpaz1zay06odz80j4g2tinjg?utm_source=link>" %}

2. Open the action panel
3. Click the **Utilities** tab

{% embed url="<https://app.supademo.com/demo/cmpaz3hhm06ofz80j3fh2ow2e?utm_source=link>" %}

The Utilities section contains workflow automation and conditional logic actions.

### Selecting IF Statement Adv &#x20;

Inside the Utilities tab:

1. Locate **IF Statement Adv**

{% embed url="<https://app.supademo.com/demo/cmpaz51vp07vuxa0jyiid527a?utm_source=link>" %}

2. Click the action to open the configuration dialog

The walkthrough highlights the advanced IF Statement element used for configuring complex conditional workflows.

### IF Statement Adv Configuration &#x20;

When configuring the **IF Statement Adv** action, several fields must be completed.

### Action Name &#x20;

The **Action Name** identifies the advanced condition workflow inside the bot builder.

This name is visible only within the workflow editor.<br>

{% embed url="<https://app.supademo.com/demo/cmpaz6c7t00d2u40jjlttxrbf?utm_source=link>" %}

**Example** &#x20;

Advanced Order Check\
Advanced Payment Validation\
Premium Customer Validation

The walkthrough demonstrates renaming the default value to:

Advanced Order Check

before saving the configuration.

### Condition Type &#x20;

The **Condition Type** field defines how multiple conditions should be combined.

Available options include:

* AND
* OR

The walkthrough specifically selects:

AND

to combine multiple conditions together.

#### AND Condition Logic &#x20;

When using **AND**:

* All configured conditions must be true for the workflow to succeed.

Example:

Payment = Successful\
AND\
Last Purchase Amount > 1000

If any condition fails, the chatbot triggers the Fail workflow.

{% embed url="<https://app.supademo.com/demo/cmpaz7h9607vyxa0jdst6xl47?utm_source=link>" %}

### Key Field &#x20;

The **Key** field defines the variable or customer attribute that should be evaluated.

To configure:

1. Open the **Key** dropdown
2. Select the required variable<br>

{% embed url="<https://app.supademo.com/demo/cmpaz8n4o07w2xa0j0vegq2i4?utm_source=link>" %}

The walkthrough first selects:

payment

as the primary condition variable.

Later, the walkthrough adds another condition using:

Last Purchase Amount

as an additional comparison field.

### Operator &#x20;

The Operator field defines how the selected value should be compared.

Available operators shown in the walkthrough include:

* Equals To
* Not Equals To
* Greater Than
* Greater Than or Equal To
* Less Than
* Less Than or Equal To
* Between

The walkthrough initially selects:

Is

for the payment condition.

For numeric comparison, the walkthrough later selects:

Greater Than

to validate the purchase amount.<br>

{% embed url="<https://app.supademo.com/demo/cmpaza21407w4xa0jin8lckb6?utm_source=link>" %}

### Is Dynamic Value &#x20;

The **Is Dynamic Value** toggle determines whether the condition value should be:

* Dynamically generated\
  or
* Manually entered as a static value

The walkthrough demonstrates disabling the toggle to manually configure fixed values for the conditions.<br>

{% embed url="<https://app.supademo.com/demo/cmpazb3nc07e9z70jbm57uszr?utm_source=link>" %}

### Value Field &#x20;

The **Value** field contains the expected comparison value for the condition.<br>

{% embed url="<https://app.supademo.com/demo/cmpazkl1907i0z70j8yzu2tl0?utm_source=link>" %}

**Example 1 — Payment Condition** &#x20;

Successful

The chatbot checks whether the payment variable matches this value.

**Example 2 — Purchase Amount Condition** &#x20;

1000

The chatbot checks whether the customer's last purchase amount is greater than this value.

### Adding Multiple Conditions &#x20;

To create advanced workflows:

1. Click **Add New Condition**<br>

{% embed url="<https://app.supademo.com/demo/cmpazdptx00dbu40js21gjtmg?utm_source=link>" %}

2. Configure another Key, Operator, and Value<br>

{% embed url="<https://app.supademo.com/demo/cmpazmf4800010k0ju61ifsez?utm_source=link>" %}

3. Repeat as required

The walkthrough demonstrates combining payment validation and purchase amount conditions inside the same workflow.

### Creating the IF Statement Adv Action &#x20;

After configuring all conditions:

1. Review the logic carefully
2. Click the **Create** button<br>

{% embed url="<https://app.supademo.com/demo/cmpb07zno07imz70jj3123xa4?utm_source=link>" %}

The advanced IF Statement node will now appear in the workflow canvas.

### Workflow Behavior &#x20;

Once triggered, the **IF Statement Adv** action:

* Evaluates multiple conditions simultaneously
* Supports complex comparison logic
* Validates text and numeric conditions
* Triggers Success or Fail workflows automatically
* Enables advanced chatbot automation

The walkthrough demonstrates configuring advanced order validation rules based on payment status and purchase amount conditions.

### Success and Fail Actions &#x20;

After creating the IF Statement Adv workflow:

* **Success** output triggers when all required conditions are satisfied<br>

{% embed url="<https://app.supademo.com/demo/cmpb0bny70007xl0jgpdonodk?utm_source=link>" %}

* **Fail** output triggers when one or more conditions fail

You can connect any chatbot action to either output.

Example:

Success → Send Confirmation Message\
Fail → Send Incomplete Payment Message

### Configuring Success Response &#x20;

To configure the success message:

1. Drag a **Send Text** node from the Success output

{% embed url="<https://app.supademo.com/demo/cmpb0hr9200ecu40j3u54tvat?utm_source=link>" %}

2. Enter the action name
3. Add the success notification message

{% embed url="<https://app.supademo.com/demo/cmpb0jih200efu40jxezuxa61?utm_source=link>" %}

4. Click **Create**<br>

{% embed url="<https://app.supademo.com/demo/cmpb0kqvr07ioz70jyfj4yrjb?utm_source=link>" %}

Example &#x20;

Bot: ✅ Your order and payment have been verified successfully.

The walkthrough demonstrates configuring a Send Text action after the success condition.

### Configuring Fail Response &#x20;

To configure the fail message:

1. Drag a **Send Text** node from the Fail output<br>

{% embed url="<https://app.supademo.com/demo/cmpb0mjso002h0k0jybt8azlj?utm_source=link>" %}

2. Enter the action name<br>

{% embed url="<https://app.supademo.com/demo/cmpb0nw6g002j0k0jitdwkbpe?utm_source=link>" %}

3. Add the fail notification message<br>

{% embed url="<https://app.supademo.com/demo/cmpb0pw8d06riz80jeglmyd7n?utm_source=link>" %}

3. Click **Create**<br>

{% embed url="<https://app.supademo.com/demo/cmpb0vkah002o0k0jqomcosra?utm_source=link>" %}

**Example** &#x20;

Bot: ❌ Payment verification failed.\
Please complete the payment to continue.

The walkthrough shows a fail message node for incomplete payment conditions.<br>

{% embed url="<https://app.supademo.com/demo/cmpb0x297082mxa0jmkkpu5vz?utm_source=link>" %}

### Publishing the Bot Changes &#x20;

After configuring the IF Statement Adv workflow:

1. Review all Success and Fail conditions
2. Click the **Publish** button
3. Deploy the updated workflow to production<br>

{% embed url="<https://app.supademo.com/demo/cmpb0ybrr06rwz80j9rg2dlci?utm_source=link>" %}

The final step of the walkthrough demonstrates publishing the configured bot logic successfully.

### Example Workflow &#x20;

**Example Chatbot Workflow** &#x20;

Collect Payment Details\
&#x20;       ↓\
IF Statement Adv\
&#x20;       ↓\
Condition 1 → Payment = Successful\
AND\
Condition 2 → Last Purchase Amount > 1000\
&#x20;       ↓\
Success → Premium Offer Message\
Fail → Payment Incomplete Message

**Example Interaction** &#x20;

User Payment Status: Successful\
Last Purchase Amount: 2500\
\
Result:\
Success

The chatbot automatically validates all configured conditions and triggers the appropriate workflow response.

### Best Practices &#x20;

Follow these recommendations when using IF Statement Adv.

#### Store variables before evaluation &#x20;

Ensure customer data is collected before applying conditions.

#### Use clear action names &#x20;

Name workflows based on their business logic.

#### Use AND and OR carefully &#x20;

Choose the correct logical operator based on workflow requirements.

#### Separate complex conditions clearly &#x20;

Organize multiple conditions for easier maintenance.

#### Test all condition paths &#x20;

Validate both Success and Fail scenarios before publishing.

### Summary &#x20;

The **IF Statement Adv** action allows chatbot builders to create **advanced multi-condition workflows inside Ownchat bots**.

With **IF Statement Adv**, you can:

* Build advanced conditional chatbot logic
* Combine multiple AND/OR conditions
* Validate numeric and text-based conditions
* Automate decision-based workflows
* Trigger dynamic Success and Fail actions

This utility action helps businesses **create powerful chatbot automation and intelligent workflow branching within Ownchat.**
