If Else Conditions in Power Automate Desktop
Conditions allow you to run action blocks only if a given situation meets. If the situation is false, the action block will be skipped.
The If statement is one of the most widely used conditions in the development of the flow. Power Automate Desktop provides the If action check to see if the given statement is valid. If the situation is true, the logic between If and End is made.
The platform supports the most important logical functions, such as equal, not equal, and greater than. The Else action defines the logic to be executed when the If condition is false.
List Variable in Power Automate Desktop
Power Automate Desktop provides some additional conditional actions:
- If file exists: Determines whether a file exists or not before executing any action or block of actions.
- If folder exists: Determines whether a folder exists or not before executing any action or block of actions.
- If service: Runs any action or block of actions if a specific service is running, is paused, or is stopped.
- If process: Runs any action or block of actions if a specific Windows process is running, or not.
- If window: Runs any action or block of actions if a specific window is open, or not.
- If window contains: Runs any action or block of actions whether a specific text or UI element exists in a window, or not.
- If image: Runs any action or block of actions whether a specific image is found on the screen, or not.
- If web page contains: Runs any action or block of actions if a web page contains a specific element or some text, or not.
- If text on screen (OCR): Determines whether a given text is found on the screen or not, with the help of an OCR Engine.
For example, we have a flow in which, if the value of ExamAttended is True then it checks the next condition if marks are greater than equals 300 or not. If yes, then it displays the message as,' Pass' else, it displays the message as,' Fail'.

Introduction to Power Automate Desktop
Creating a flow with If-Else Condition
- Open Power Automate Desktop App.

- Firstly, we need to create a flow. Click on New flow.

- Give some name to the flow and click on Create. Here, we are creating a flow with the name "If-Else-Condition Flow".

- Drag and drop Set Variable action from Actions pane to the workspace. Name the variable as Marks. Add value to the variable as 500 and click on Save.

- Again, drag and drop Set Variable action from the Actions pane to the workspace. Name the variable as ExamAttended. Add value to the variable as True and click on Save.

- Drag and drop If action from Actions pane to the workspace. Add the first operand as our variable ExamAttended. Add Operator as Equal to (=) and second operand as True and click on Save.

- Drag and drop Display message action from Actions pane to the workspace. Add message title as Result. Add value as True in Message to display. Click on Save.

- Here, this is how our flow should look now. Make sure that you add the Display message inside the If scope.

- Here, we get the output as True as it satisfies the condition.

- Drag and drop If action from Actions pane to the workspace. Add the first operand as our variable Marks. Add Operator as Greater than or Equal to (>=) and second operand as 300 and click on Save.

- Drag and drop Display message action from Actions pane to the workspace in the If scope. Add message title as Result. Add value as Pass in Message to display. Click on Save.

- Drag and drop Else action from Actions pane to the workspace.

- Drag and drop Display message action from Actions pane to the workspace in the Else scope. Add message title as Result. Add value as Fail in Message to display. Click on Save.

- Here, this is how our flow should look now. Make sure that you add the Display message inside the If scope as well as in Else scope. Move the Else into the If scope.

- Save and Run the flow. We get the output as Pass as we have set the variable value as 500.

- Now, if change the value of Marks variable as 250 and Run the flow. We get the output as Fail.

File Actions in Power Automate Desktop
In the previous articles, we have seen If-Else and Switch conditional actions. Now, we will learn about the advanced conditional actions which include If process, If folder exists, and If file exists. These actions majorly focus on automating simple desktop-related tasks.
- If process: Checks the conditional block of statements depending on whether a process is running or not.
- If folder exists: Checks the conditional block of statements depending on whether a folder exists or not.
- If file exists: Checks the conditional block of statements depending on whether a file exists or not.
- Open Power Automate Desktop App.

- Firstly, we need to create a flow. Click on New flow.

- Give some name to the flow and click on Create. Here, we are creating a flow with the name "If-folder-file-process-flow".

Database Actions in Power Automate Desktop
About Author : I am Sharvari Raut, having sound knowledge and experience in technical writing. Currently, pursuing my B.Tech in Computer Science and Engineering.