activities
latest
false
UiPath logo, featuring letters U and I in white

Workflow Activities

Last updated Dec 6, 2024

Switch

System.Activities.Statements.Switch

Enables you to execute a single course of action out of multiple options, based on a specified condition. The activity consists of a conditional expression and a collection of cases, each containing a corresponding activity or set of activities. The Switch activity executes a single case in the collection, based on its match with the conditional expression. If the condition does not match any of the cases, the Default one is executed. The Switch activity can be used instead of an If activity if the condition has to be tested against three or more cases.

Project compatibility

Windows | Windows - Legacy | Cross-Platform

Configuration

  • Expression - The statement according to which one of the cases is executed. By default, the variable type supported by this field is Int32. To change the type, select a different option in the TypeArgument drop-down list.
  • Default - The activities added here are used if no case is matched.
  • Cases - All the possible sequences out of which a single one is executed based on its match with the provided Expression. You can only have one Default case. If no Default case is added, the project is executed, but the activity does not return any output.

Properties Panel

  • DisplayName - The name displayed for the activity in the Designer panel.
  • Expression - The statement according to which one of the cases is executed. By default, the variable type supported by this field is Int32. To change the type, select a different option in the TypeArgument drop-down list.
  • Private - If selected, the data used in the activity is not logged.
  • TypeArgument - Select the type of statement that can be added in the Expression field. The default option is String.

Important!

This activity is built by Microsoft. For more information, see their official documentation.

  • Project compatibility
  • Configuration
  • Properties Panel

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.