UiPath Switch Activity Example

UiPath Switch Example

When it comes to conditional logic in UiPath, most RPA developer’s go to uitility is the UiPath if activity. However, if you have an expression that can produce multiple logical branches, the UiPath Switch Activity is a better option.

In this UiPath Switch Example, I use an int32 variable named players as the expression, and then use a message box to display what type of sports team could be created with a given number of players:

  • Hockey for 6
  • Cricket for 11
  • Hurling for 15

And for the UiPath Switch’s default case, I just tell the user to go surfing as a default.

It’s a very simple little UiPath Switch tutorial, but if you want to see how this popular alternative to the UiPath if else activity works, I think you’ll find it very informative.

UiPath Switch on a String

It’s worth noting that this example does a switch on an int32 value. It’s also to switch on a String as well.