Switch Case Conditionals In Desktop Flow Using Microsoft Power Automate

Microsoft Power Automate is a software by Microsoft for automation of recurring tasks. It is part of the Microsoft Power Platform line of products together with products such as Power Apps and Power BI. More Details here.

Desktop flows are the existing robotic process automation (RPA) capabilities in Power Automate and enable to automate all repetitive desktop processes. More Details here.

Switch - Dispatches execution to different parts of the switch body based on the value of the expression, Case -An expression that, if met, a block of actions associated with that particular case runs, Default case - A block of actions that is run, if no case expression has been met in the switch body.

Reading this article, you can learn how to use Switch Case Conditionals in Desktop flow using Microsoft Power Automate.

The following important tools are required for developing Microsoft Power Automate,

  1. Windows 10/11 (Recommended)
  2. Power Automate Desktop - Download the Power Automate installer

Now we can discuss step by step App development.

Step 1

Open Microsoft Power Automate -> New Flow

Next, Give the Flow name as PADSwitchCase, Click the Create button,

After that, we are able to see the Desktop flow,

Step 2

For Testing Switch Case Conditionals,

First, Add the Input Variable,

Set the Variable Name parameter as DayChoice, Data Type as Number and External name as DayChoice and click Save,

Next, Add the Switch action,

Set the Value to check parameter as %DayChoice%

Next, Add the Case action, Set Value to compare parameter as 1

For Displaying the Choice Day, Add the Display message action, Set the Message box Title parameter as DisplayMSG1, Message to display parameter Monday and click Save,

Similarly, Add the Case action and Display Message action for all the Seven Days,

Next, Add the DefaultCase action,

For Displaying the Choice Day, Add the Display message action, Set the Message box Title parameter as DisplayMSGNo, Message to display parameter No Day Matched with the Number and click Save,

Now, Save the PADSwitchCase Desktop Flow,

Step 3

Now we can run your PADSwitchCase Desktop Flow in Microsoft Power Automate,and the output of the PADSwitchCase is,


Now you have successfully tested Switch Case Conditionals in Desktop flow - PADSwitchCase in Microsoft Power Automate