In the development of UiPath Studio, there are times when I want to separate the process depending on the condition.
However, since there are multiple ways to divide the process according to conditions, many people may not know which one to use.
In this article, we will introduce how to use “If”, “Switch”, “Flow Decision”, and “Flow Switch” for activities that divide processing according to conditions.
\Save during the sale period!/
Take a look at the UiPath course on the online learning service Udemy
*Free video available
Related Articles Learn the Creation Techniques f UiPath robotics creation with Udemy’s online courses that take it up a notch
This site was created by translating a blog created in Japanese into English using the DeepL translation.
Please forgive me if some of the English text is a little strange
how to use If, Switch, Flow Decision, Flow Switch
If and Switch can be used in both Flowchart and Sequence, but they do not allow you to go back to the previous activity.
Flow Decision and Flow Switch can only be used in Flowchart to go back to the previous activity.
The table below shows the results.
activity | Flowchart | Sequence | multiple branch | Back to Previous Activity |
If | 〇 | 〇 | × | × |
Switch | 〇 | 〇 | 〇 | × |
Flow Decision | 〇 | × | × | 〇 |
Flow Switch | 〇 | × | 〇 | 〇 |
If
If is located in the activity System>Activities>Statements.
If can be used to change the process depending on whether the condition is satisfied or not.
The expression (condition) that determines whether a condition is satisfied should be of type Boolean.
Sample code for an expression (condition) to determine if String types str1 and str2 match.
str1 = "abc"
str2 = "xyz"
String.Equals(str1,str2)
Judges whether the strings in str1 and str2 match, and outputs a “Yes” message if true, or a “No” message if false.
・Execution result 1
Sample code for an expression (condition) to determine if int2 is greater than int1 of type int
int1 = 100
int2 = 10
int1 > int2
・Execution result 2
Switch
The Switch is located in the activity System>Activities>Statements.
Switch is used when you want to change the process for multiple conditions.
It judges whether str1 is Japan, France, Brazil, or other, and executes the message box with the matching condition.
・Switch Properties
*TypeArgument is changed to String.
・Execution result 1
It judges whether str1 is Japan, France, Brazil, or other, and executes the message box with the matching condition.
・Switch Properties
※TypeArgument is Changed to String
・Execution result 2
Flow Decision
Flow Decision can be found in Workflow > Flowchart.
Flow Decision is used when you want to change the process depending on the conditions on the flowchart.
Judges whether int2 is greater than int1, and processes it according to True or False.
・FlowDecision Properties
・Execution result 1
Judges whether the value of the dialog input result is less than or equal to 10, and displays an OK message box if it is true, or a message box to prompt for retyping if it is false, and returns to the dialog input.
・InputDialog Properties
・FlowDicision Properties
・Message Box Retry Properties
・Message Box OK Properties
・Execution result 2-1
・Execution result 2-2
Flow Switch
Flow Switch can be found in Workflow > Flowchart.
Flow Switch is used when you want to change the process depending on multiple conditions on a flowchart.
Judges whether the value of str1 matches the value of each Case, and outputs a message box where the value of str1 matches the value of Case.
If the conditions do not match, the Case with the IsDefaultCase checkbox is executed.
・FlowSwitch Properties
・Default property for branching
・France property for branching
・Japan property for branching

・Message Box Default
・Message Box France
・Message Box Japan
・Execution result
Summary
- If you want to change the process depending on whether a condition is met or not, use If.
- If you want to divide the process by multiple conditions, use Switch
- Use Flow Decision and Flow Switch when you want to process conditions separately in a flowchart, or when you want to return to the processing of the previous activity.
\Save during the sale period!/
Take a look at the UiPath course on the online learning service Udemy
*Free video available
Related Articles Learn the Creation Techniques f UiPath robotics creation with Udemy’s online courses that take it up a notch
same category UiPath

Japanese IT engineer with a wide range of experience in system development, cloud building, and service planning. In this blog, I will share my know-how on UiPath and certification. profile detail / twitter:@fpen17