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.
Open Bot Builder
Click the Add Node button
Open the Utilities tab
Select Switch Case
Configure the condition settings
Add variables or additional conditions if required
Click Create
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:
Click Add Node
Open the action selection panel
Click the Utilities tab
The Utilities section contains workflow logic and automation actions.
Selecting Switch Case
Inside the Utilities tab:
Locate Switch Case
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:
Open the Input Value dropdown
Select the required customer field
The walkthrough demonstrates selecting:
name
from the available customer fields.
Other available fields shown include:
Lead Status
Email
Tags
WhatsApp Name
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:
Click Add New Condition https://app.supademo.com/demo/cmpb2vx6o0891z70j2bgcdud1?utm_source=link
Configure another condition block
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:
Click Add Variable https://app.supademo.com/demo/cmpb2ztkm00o7u40jdqpqwny7?utm_source=link
Select the required variable or customer field
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:
Click the Delete icon https://app.supademo.com/demo/cmpb32kxb0766z80jpy8rg4p4?utm_source=link
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:
Review the matching logic
Click the Create button https://app.supademo.com/demo/cmpb34p2h08a2z70jrjk76prj?utm_source=link
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:
Review the matching logic
Click the Update button https://app.supademo.com/demo/cmpb3d8eo000ry60joxgkp3zp?utm_source=link
Publishing the Bot Changes
After configuring the Switch Case workflow:
Review all configured conditions
Click the Publish button https://app.supademo.com/demo/cmpb3ffne00pau40j3c098308?utm_source=link
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