switch.md


version: "2026.1.0" language: "en"

Switch

The Switch block routes your automation based on an Input value. It checks the input against multiple cases and continues through the first case that matches, using the selected Comparison method and Comparison type. If no cases match, the flow continues through No match (default).

Fully expanded, the Switch block shows the following properties:

Note: The screenshot on this page uses the Elegance Design , introduced in 2025.3. If you are using an earlier version, your layout may look different.

Quick-start

  1. Drag Switch onto the canvas.
  2. Connect the block in the flow and optionally specify the basic parameters required for this block to operate, listed by their exact UI labels in one line: Input , Add case , Comparison method , Comparison type.
  3. Run the flow when it's ready.

Building block parameters

Parameters

For example, comparing the text 200,200 with the position 200,50 results in false, but comparing the position 200,200 with the position 200,50 results in true.

The dropdown includes the following options:

Let's understand this using an example:

Scenario: Routing Actions Based on Text Value

The Set Text block sets the text value to "Completed." This value is sent into the Switch block as Input. The Switch block checks what the value is:

Since the value is Completed , the flow always goes to the Pass block.

Resources

Topic Description
Flows FAQ Common questions about creating, running, and managing flows in Leapwork.
Flows Troubleshooting Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.