订阅

UiPath 活动

UiPath 活动指南

Switch

System.Activities.Statements.Switch

描述

Enables you to execute a single course of action out of multiple options, based on a preset 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.

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.

属性

Common

  • DisplayName - The display name of the activity.

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
  • “表达式”- 执行某个 case 子句时所要遵循的语句。默认情况下,该字段支持的变量类型为 Int32。如要更改类型,请在“类型参数”下拉列表中选择其他选项。
  • “类型参数”- 用于选择可在“表达式”属性中添加的语句类型。系统会默认选择 Int32。

Important!

此活动由 Microsoft 构建。如需了解更多信息,请参阅其官方文档

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.

配置活动

In the Body of the Activity

  • Expression - Click Plus plus button on the right side of the field and then, from the menu, select the expression using one of the available options:
    • Data from the Project Notebook, a parent Excel file or Outlook account. For example, you can select a cell in an Excel file.
    • Use Saved Value - Select a value you previously saved for later use in the project
    • Text - Enter an expression in the Text Builder.
    • Ask when run - Prompt for an expression when the project is executed.
    • Open in Advanced Editor - Enter a VB expression.

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.

To add a case, click Add new case, and then enter a case value. Add the activities to execute inside the case.

In the Properties Panel

Common

  • DisplayName - The name displayed for the activity in the Designer panel.

Misc

  • Expression - See Expression in the body of the activity.
  • Private - If selected, the data used in the activity is not logged by StudioX.
  • TypeArgument - Select the type of statement that can be added in the Expression field. The default option is String.

大约一年前更新


Switch


建议的编辑仅限用于 API 参考页面

You can only suggest edits to Markdown body content, but not to the API spec.