A few weeks ago, I was working on a Power Automate flow where I needed to make decisions based on user input and SharePoint list values, like using “if” statements in programming. That’s when I realized how powerful the if expression and the built-in Condition control in Power Automate are.
By using the Power Automate if expression, you can check if a value is null, compare numbers, or branch out into more complete nested conditions.
In this tutorial, I will explain everything about IF Expression in Power Automate, from basic if expressions to nested conditions, handling null values and booleans, and even combining conditions with OR.
I will also provide practical, real-world examples using SharePoint lists, forms, and Teams notifications, allowing you to apply them to your workflows easily.
Power Automate Expression If Statement
In Power Automate, the if expression is used within expressions to evaluate a condition and return one value if the condition is true and another value if it’s false.
It’s similar to an “if” statement in programming languages but written in a specific syntax for Power Automate (which uses Microsoft’s Power Fx or workflow expression language).
Power Automate If Statement Syntax:
if(expression, valueIfTrue, valueIfFalse)

- expression: A logical expression that evaluates to true or false (equals(1, 1) or greater(5, 3)).
- valueIfTrue: The value returned if the condition is true.
- valueIfFalse: The value returned if the condition is false.
For Example:
if(equals(2, 2), 'Yes', 'No')
Result:

‘Yes’ (because 2 equals 2, the condition is true, so it returns ‘Yes’).
Check out Send Email Using REST API in Power Automate
Power Automate Condition Control Action
The Condition Control Action in Microsoft Power Automate allows you to introduce conditional logic into your flows. It acts like an “if-then-else” statement in programming languages, enabling your flow to make decisions and execute specific actions based on whether a defined condition evaluates to true or false.
Check the screenshot below:

How to use Condition Control Action in Power Automate
To see how to use this, consider a simple scenario. Suppose you have a SharePoint list called “Sales Tracker” with a column named “Revenue” (a number field).
Here, you want to create a flow that sends an email notification to a manager when a new item is added, but only if the revenue exceeds $10,000.
Follow the below steps:
- Go to the Power Automate site. Click on “+ Create” in the left pane, then select “Automated cloud flow.” Name your flow “High Revenue Alert” and choose the trigger When an item is created (SharePoint connector). Then, provide your SharePoint site and the “Sales Tracker” list.

- Add a Condition control action. In the left box, click to open the Dynamic content panel, and select “Revenue” from the “When an item is created” trigger. In the middle dropdown (operator), choose “is greater than.” In the right box, type 10000 (representing $10,000).

- In the True section, add Send an email (V2) action and provide the below parameters:
- To: Enter the manager’s email address.
- Subject: High Revenue Alert: New Sale Added!
- Body:
A new sale with Revenue of @{triggerBody()?['Revenue']} was added to the Sales Tracker.

- Click “Save” at the top. Go to your SharePoint list and add a new item with a “Revenue” value ($15,000 to trigger the “If yes” path).

After the flow runs successfully, you can see the manager can receive the below email notification:

Power Automate Else Expression
In Power Automate, there isn’t a standalone else expression like you might find in programming languages. Instead, the “else” logic is handled as part of the if expression or through the structure of a flow using actions like the Condition control.
Let me explain how you can implement “else” logic in Power Automate using expressions and Condition control:
Example 1: If-Else with Expression in Power Automate
Suppose you want to check if a number is greater than 10 and return “High” if true or “Low” if false.
In a Compose action, add the below expression:
if(greater(15, 10), 'High', 'Low')

After the flow runs successfully, you can see the result in the Output Section:

Example 2: Using the Condition Action for If-Else Logic in Power Automate
Here, I use the same type of condition if a five is greater than 10 and return “High” if true or “Low” if false.
Create an instant cloud flow with a trigger (Manually trigger a flow), then add a condition control action and provide the following:
5 is greater than 10

In the “True Section” section, add a Compose action and provide the value “High.” In the “False Section” section, add another Compose action and provide the value “Low.”

After the flow runs successfully, you can see the False section will run the result in the Output Section:

Power Automate Nested If for Multiple Conditions
In Power Automate, nested “If” statements are useful for handling multiple conditions when evaluating a series of criteria in a specific order.
There are other approaches, such as using expressions or the “Switch” action.
Imagine you’re sorting tasks:
- First, check if the task is “High” priority.
- If yes, check the department.
- If it’s “IT,” send it to the IT boss.
- If it’s “HR,” send it to the HR boss.
- If it’s neither, send it to a regular boss.
- If no (not “High”), send it to a team leader.
- If yes, check the department.
Follow the below steps to check nested “If” statements in Power Automate:
You have a string variable called Status with these possible values:
- “Pending”
- “Approved”
- “Rejected”
You want to return:
- “Needs Review” if it’s “Pending”
- “Completed” if it’s “Approved”
- “Denied” if it’s “Rejected”
- “Unknown Status” for anything else
Create a variable action and give the name a varStatus, Type as String, and value as Pending:

Then, add a compose action and provide the below expression:
if(equals(variables('varStatus'), 'Pending'), 'Needs Review',
if(equals(variables('varStatus'), 'Approved'), 'Completed',
if(equals(variables('varStatus'), 'Rejected'), 'Denied',
'Unknown Status')))

After the flow runs successfully, you can see the result in the Output Section:

Note that you can use nested Condition controls in Power Automate to build complex logic. However, there is a limit—you can nest Conditions only up to 8 levels deep. If you try to nest a 9th Condition, Power Automate will display an error saying the condition is nested too deeply.
Power Automate IF Expression Examples
In the above, I explained the Power Automate IF expression, condition control, if statements, and how to use nested IF for multiple conditions.
Now I will show you some comment examples where we are using them in Power Automate
Power Automate IF expression null
Suppose you want to create a flow that assigns tasks to users, where the manager provides the task name, assigned to, task description, and due date.

You want the flow to notify the assigned user based on the manager’s input and store the task details in a SharePoint list.
Sometimes, the due date is left blank (null). If it is null, you want to set a default value (today’s date); otherwise, use the provided date.
To do this, follow the below steps:
- Open the Power Automate Home page and choose Instant cloud flow with the trigger: Manually trigger a flow. Click on +Add an Input to add two text inputs (Start Date and End Date), an Email input, and a Date input to allow users to enter the leave period manually. Then click the three dots in the Due Date, then check the checkbox to make the field optional.

- Add a Compose action and provide the below expression:
if(equals(triggerBody()?['date'], null), utcNow('yyyy-MM-dd'), triggerBody()?['date'])

Where:
- triggerBody()?[‘date’]: Gets the date field value from the trigger.
- equals(triggerBody()?[‘date’], null): Checks if the date field is null (empty).
- utcNow(‘yyyy-MM-dd’): Returns the current date in the format 2025-04-04.
- if(condition, value_if_true, value_if_false): The full if statement checks if the date is null: if yes, use today’s date; if no, use the original date.
This expression checks if the date field in the trigger body is empty (null). If it is empty, it uses the current date in yyyy-MM-dd format. If not, it uses the existing date value.
- Add Post a message in a chat or channel action and provide the below parameters:
- Post as: Flow bot
- Post in: Chat with Flow bot and the assigned user
- Recipient: Provide the assigned to from dynamic content
- Message: Provide the below:
👋 Hi,
You’ve been assigned a new task: @{triggerBody()?['text']}
📅 Due Date: @{outputs('Compose')}
📝 Description: @{triggerBody()?['text_1']}
Please check the SharePoint task list for more details.

- Add a Create item action (SharePoint connector) and provide the below required parameters:
- Site Address: Select your SharePoint site.
- List Name: Select your list.
- Project Name: Use the Task Name from the form’s dynamic content.
- Description: Use the Task Description from the form’s dynamic content.
- Assigned To Claims: Use the A Email from the form’s dynamic content.
- Due Date: Use the output of the above compose action.

Now save the flow and run it manually. Then manually enter the Task Name, Description, and assigned person and leave the Due date blank. Next, click the Run Flow button.

Once the flow runs successfully, go to the SharePoint list or Microsoft Teams to verify that a new item has been added, along with the due date.

Power Automate IF Expression Boolean
Let’s say you have a SharePoint list called Task Tracker with a column named IsCompleted (Yes/No).

You want to send an email to the manager only if the task is completed.
To do this, follow the below steps:
- Create an automated cloud flow with the trigger “When an item or a file is modified.” Provide the Site Address and set the List Name as “Task Tracker.”

- Add a Condition action and add the below:
@{triggerBody()?['IsCompleted']} is equal to true

- Inside the True section, add the Send an email action and provide the required parameters:
- To: Enter the manager’s email address.
- Subject: @{triggerBody()?[‘TaskName’]} Task Completed
- Body:
Hi Manager,
The following task has been marked as Completed.
Task Name: @{triggerBody()?['TaskName']}
Completed On: @{formatDateTime(utcNow(),'dd/MM/yyyy HH:mm ss')}
Regards,

Now, save the flow, go to the SharePoint list, and select one task to mark as completed.

After the flow runs successfully, the manager will receive the email below:

Power Automate IF Expression Equals
Let’s say you want to manually run a flow where a user inputs a department name ( “Finance”, “HR”, “IT”).
Based on the department, the flow checks if it is “Finance” and then sends a different message accordingly using the if expression.
To do this, follow the below steps:
- Open the Power Automate Home page and choose Instant cloud flow with the trigger. Manually trigger a flow. Click on +Add an Input to add text inputs (Department) to allow users to enter manually.

- Add a compose action and provide the below expression:
if(equals(triggerBody()['text'], 'Finance'), 'Finance department selected. Processing finance workflow...', 'This is not Finance. Running general workflow...')

- Now save the flow and run it manually. It will ask you to select a department, then provide the department as Finance.

After the flow runs successfully, you can see the result in the output of the compose action.

Power Automate Expression If OR
You have a SharePoint list named ‘Leave Requests’ with a column called ‘Leave Type. ‘ You want to check if the Leave Type is either “Sick Leave” or “Emergency Leave”. If so, could you send an email to HR? If not, could you send an email to the Team Lead?
To do this, follow the below steps:
Create an Automated cloud flow and with trigger “When an item is created” and provide the side address where “Site Address” is present and the select the list name form the drop down:

Add a condition control action and provide the following things:
@{triggerBody()?['LeaveType/Value']} is equal to Sick Leave
OR
@{triggerBody()?['LeaveType/Value']} is equal to Emergency Leave

Inside the True section, add Send an email (V2) action and provide the below required parameter:
- To: Enter the HR email address.
- Subject: Leave Request Notification: @{triggerBody()?[‘LeaveType/Value’]}
- Body:
Hello HR Team,
A new leave request has been submitted.
Employee Name: @{triggerBody()?['EmployeeName/DisplayName']}
Leave Type: @{triggerBody()?['LeaveType/Value']}
Start Date: @{triggerBody()?['StartDate']}
End Date: @{triggerBody()?['EndDate']}
Please review the request in the SharePoint list.
Thanks,
Power Automate

Inside the False section, add Send an email (V2) action and provide the below required parameter:
- To: Enter the Team Lead email address.
- Subject: Leave Request Notification: @{triggerBody()?[‘LeaveType/Value’]}
- Body:
Hello Team Lead,
A new leave request has been submitted.
Employee Name: @{triggerBody()?['EmployeeName/DisplayName']}
Leave Type: @{triggerBody()?['LeaveType/Value']}
Start Date: @{triggerBody()?['StartDate']}
End Date: @{triggerBody()?['EndDate']}
Please review the request in the SharePoint list.
Thanks,
Power Automate

Now save the flow and go to the SharePoint list. Add an item where the Leave Type is “Sick Leave.” If the flow runs, Patti (who is the HR in this case) will receive an email.

After the flow runs successfully, you can see that Patti receives the email notification.

Conclusion
In this tutorial, we covered how to use the if expression in Power Automate to handle conditional logic, similar to if-else statements in programming. We explained the syntax of the if() function and how to use it with expressions like equals(), greater(), and null checks. We also saw the Condition control action to perform different actions based on true or false conditions.
Examples included checking revenue in a SharePoint list, handling optional fields like due dates, using nested if statements for multiple conditions, working with Boolean values, comparing text input, and checking multiple conditions using OR logic.
You may also like the following Power Automate tutorials:
- Check If an Array Contains Value in Power Automate
- Check If an Array is Empty in Power Automate
- Check If the Body is Empty in Power Automate
- Check If the Column is Changed in Power Automate
- Delete Files From SharePoint Document Library Using Rest API in Power Automate

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.
please how do i resolve this
get items returns [] output.
the filter query returns the correct result but the output is empty