Skip to main content

Switch Case

The Switch Case tool allows you to create decision points in your workflows. It lets you define specific conditions and branch your workflow accordingly, making it highly dynamic and tailored for various scenarios. It makes workflows adaptable, enabling you to efficiently handle diverse conditions and execute tasks based on specific criteria.

An overview of the Switch Case tool in workflows.

How to Use Switch Case

  1. Add a Case Click the plus icon to add a new case to the Switch Case node. You can define multiple cases based on your workflow's requirements.

    Click the plus icon to add a new case.
  2. Select the Case Type Choose the type of value the condition will evaluate, such as String, Number, etc. This step helps you define how the workflow will handle different input values.

    Choose the type of value for the case, such as String or Number.
  3. Define the Case and Outcome Specify the case value (e.g., "get_users") and assign an outcome or action associated with that value. For instance, if the case value matches "get_users," the workflow will execute the corresponding action.

    Enter the case value and link it to an outcome.

Example Table

TypeCaseOutcome
Stringget_usersRuns the get_users action.
Stringget_todosRuns the get_todos action.
Stringget_photosRuns the get_photos action.
Numberget_numberRuns the get_number task.
Copilot dark logo

More than just a virtual AI assistant, Copilot adds the flavor of interaction and engagement to your website. Easy to create, easier to customize, and easiest to deploy. Let Copilot enhance user experience on your website based on the information you provide.

Is this page useful?