For the complete documentation index, see llms.txt. This page is also available as Markdown.

Switch Case

The Switch Case action allows chatbot builders to create advanced conditional routing logic inside chatbot workflows.

This utility action checks whether an input value matches a defined condition and automatically triggers the appropriate workflow action based on the result.

Unlike standard IF conditions, Switch Case is designed for handling multiple matching scenarios more efficiently using condition types such as:

  • Equals To

  • Contains

The walkthrough demonstrates configuring Switch Case logic using customer fields, exact matching, contains conditions, case-sensitive validation, variables, and workflow branching.

When to Use Switch Case

Use the Switch Case action when your chatbot workflow needs to handle multiple input matching conditions dynamically.

Common Use Cases

  • Customer name validation

  • Company name matching

  • Department routing

  • Lead qualification

  • Keyword-based workflow routing

  • Dynamic customer segmentation

Example Interaction

Input: ABC Company Condition: Contains → Company Result: Trigger next workflow action

The chatbot automatically routes the workflow when the condition matches.

How to Add Switch Case

Follow these steps to add the Switch Case action to your bot workflow.

  1. Open Bot Builder

  2. Click the Add Node button

  3. Open the Utilities tab

  4. Select Switch Case

  5. Configure the condition settings

  6. Add variables or additional conditions if required

  7. Click Create

  8. Click Publish to deploy the workflow

The walkthrough demonstrates selecting the Switch Case action from the Utilities section.

Accessing the Utilities Section

To access the Switch Case action:

  1. Click Add Node

  1. Open the action selection panel

  2. Click the Utilities tab

The Utilities section contains workflow logic and automation actions.

Selecting Switch Case

Inside the Utilities tab:

  1. Locate Switch Case

  1. Click the action to open the configuration panel

The walkthrough highlights the Switch Case element used for configuring advanced conditional workflows.

Switch Case Configuration

When configuring the Switch Case action, several fields must be completed.

Action Name

The Action Name identifies the Switch Case workflow inside the bot builder.

This name is visible only within the workflow editor.

Example

Customer Name Check Company Validation Lead Routing

The walkthrough demonstrates renaming the default value to:

Case

before saving the configuration.

Condition Type

The Condition Type field defines how the chatbot should compare the input value.

Available options shown in the walkthrough include:

  • Equals To

  • Contains

Equals To

The Equals To condition checks for an exact match between the input value and the configured value.

Example:

Input = Dheva

The condition succeeds only when the values match exactly.

Contains

The Contains condition checks whether the input includes a specific word or phrase, even if additional text exists.

Example:

Input: ABC Company Private Limited https://app.supademo.com/demo/cmpb2ghhr072sz80j6y2wqkpd?utm_source=link Condition: Contains → Company

The condition succeeds because the word Company exists inside the input value.


Case Sensitive Option

The Case Sensitive toggle determines whether the condition should consider uppercase and lowercase characters during comparison. https://app.supademo.com/demo/cmpb1czaw07mmz70jhkry6mp7?utm_source=link

When Enabled

The value must match the exact letter casing.

Example:

Input: Dheva Condition Value: dheva Result: Fail


When Disabled

The comparison ignores uppercase and lowercase differences.

Example:

Input: Dheva Condition Value: dheva Result: Success

The walkthrough demonstrates enabling and disabling the Case Sensitive option.


Input Value

The Input Value field specifies the customer field or variable that should be evaluated.

To configure:

  1. Open the Input Value dropdown

  2. Select the required customer field

The walkthrough demonstrates selecting:

name

from the available customer fields.

Other available fields shown include:


Value Field

The Value field defines the expected comparison value for the Switch Case condition.

Example

Dheva

The chatbot compares the selected input field against this value. https://app.supademo.com/demo/cmpb2umrv00nzu40jwusnlwdh?utm_source=link


Add New Condition

To create additional conditions:

  1. Configure another condition block

  2. Repeat as needed

This allows multiple matching conditions to be handled within the same Switch Case workflow.


Adding Variables

You can dynamically insert variables into the Value field.

To add a variable:

  1. Select the required variable or customer field

  2. Insert the variable into the Value field

The walkthrough demonstrates selecting:

name

from the customer fields list.

The inserted variable appears as:

{{customer.name}}

inside the Value field. https://app.supademo.com/demo/cmpb31bsw00o9u40jgu7i05k1?utm_source=link


Removing Variables

If a variable is no longer required:

  1. Remove the selected variable from the condition

The walkthrough demonstrates removing unwanted variable conditions using the delete action.


Dynamic Value Toggle

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

  • Dynamically generated or

  • Entered manually as a static value

The walkthrough demonstrates using both static and dynamic matching configurations.


Creating the Switch Case Action

After configuring all conditions:

  1. Review the matching logic

The Switch Case node will now appear in the workflow canvas.


Workflow Behavior

Once triggered, the Switch Case action:

  • Evaluates input values dynamically

  • Supports exact and partial matching

  • Handles multiple conditions

  • Supports case-sensitive validation

  • Triggers workflow routing automatically

The walkthrough demonstrates both Equals To and Contains condition logic for customer and company validation workflows.


Example Workflow

Example Chatbot Workflow

Collect Customer Name ↓ Switch Case ↓ Condition: Contains → Company ↓ Trigger Business Workflow


Example Interaction

Customer Input: ABC Company https://app.supademo.com/demo/cmpb3c7lk00p0u40jdvaqutp7?utm_source=link Condition: Contains → Company Result: Business Workflow Triggered

The chatbot automatically routes the customer based on the configured matching condition.

Creating the Switch Case Action

After configuring all conditions:

  1. Review the matching logic


Publishing the Bot Changes

After configuring the Switch Case workflow:

  1. Review all configured conditions

  2. Deploy the updated workflow to production

The walkthrough concludes by publishing the configured Switch Case logic successfully.


Best Practices

Follow these recommendations when using Switch Case.

Use meaningful action names

Clearly identify the purpose of the routing logic.

Choose the correct condition type

Use:

  • Equals To for exact matches

  • Contains for partial matching

Configure case sensitivity carefully

Enable case sensitivity only when exact letter casing matters.

Keep conditions organized

Avoid overly complex matching logic inside a single workflow.

Test all matching scenarios

Validate every condition before publishing the bot.


Summary

The Switch Case action allows chatbot builders to create advanced input-based routing workflows inside Ownchat.

With Switch Case, you can:

  • Match exact or partial values

  • Handle multiple workflow conditions

  • Use dynamic customer variables

  • Enable case-sensitive validation

  • Automate conditional workflow routing

This utility action helps businesses build smarter chatbot decision-making and dynamic workflow automation within Ownchat.

Last updated