Skip to main content

How to Use the or() Function in Power Automate

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Sometimes a flow should go ahead when any one of several things is true: the person is in payroll, or they approve this department. or() checks a list of conditions and is true when at least one of them is.

Syntax​

General form
or(<expression1>, <expression2>, ...)

From Microsoft's functions reference:

  • <expression1>, <expression2>, … (required): the conditions to check, each one true or false. Usually they're other functions, such as equals() or contains(). Two or more.
  • The result is true when at least one condition is true, and false when all are false.

Microsoft's examples: or(true, false) is true; or(equals(1, 2), equals(1, 3)) is false.

and() is its partner: true only when every condition is (How to Filter an Array by Two Conditions in Power Automate).

The example is Get Overtime Report, a flow of the Overtime Timesheet app. It has the month's approved overtime entries and must keep only those the person running it may see. Payroll staff may see every entry; an approver may see the entries of the departments they approve.

Step 1: Write Each Condition on Its Own​

Work out each condition first:

Condition 1: the person is in payroll
equals(outputs('Is_payroll'), true)
Condition 2: they approve this entry's department
contains(variables('MyDepartmentIds'), int(string(item()?['DepartmentId'])))
  • outputs('Is_payroll') is the Compose result, and equals(..., true) is true when it's true.
  • contains() is true when the list of department IDs the person approves, the array variable MyDepartmentIds, includes the entry's DepartmentId. int(string(...)) turns the SharePoint number into a whole number first, or contains() never matches (Fixed: contains() Returns False for a SharePoint Number in Power Automate).
  • item() is the entry Filter array is checking.

Step 2: Join Them with or()​

Put both conditions inside or(), separated by a comma. In Filter array's advanced mode the expression starts with @:

Entries the caller may see → Filter Query (advanced mode)
@or(equals(outputs('Is_payroll'), true), contains(variables('MyDepartmentIds'), int(string(item()?['DepartmentId']))))

Select Edit in advanced mode under the condition and paste it into the box, as one line:

The Entries the caller may see pane: From set to value from SharePoint, and Filter Query in advanced mode set to an or(...) expression token, with Edit in basic mode greyed out

Edit in basic mode is greyed out: an or() stays in advanced mode.

The Result​

For a payroll officer, the first condition is true for every entry, so the filter kept them all, and the app showed every department:

The Reports screen for November 2026: Showing: All departments, Approved hours in November 2026: 20.25, 6 entries from 4 people, a chart of Emergency Department 10 and Radiology 10.25 from 0 to 14, the lines Emergency Department: 10.00 hours and Radiology: 10.25 hours, and four person cards

For Daniel Brooks, who approves Radiology and isn't in payroll, only the second condition can be true, and only for Radiology's entries:

The Reports screen for November 2026: Showing: Radiology, Approved hours in November 2026: 10.25, 3 entries from 3 people, a chart with one Radiology column of 10.25, and three person cards: Admin User 4.00, Maya Patel 3.75 and Daniel Brooks 2.50 hours in Radiology

Common Mistakes​

MistakeWhat happensDo this instead
and() where any one condition should doPayroll staff see only the departments they approveor()
or() where every condition must holdItems that match one condition get throughand()
Starting the box with /The token menu opensStart the advanced-mode expression with @

Troubleshooting​

SymptomLikely causeFix
Everyone sees everythingThe first condition is always trueCheck the Compose in a run: it should be false for most people
Payroll staff see only their own departmentsThe first condition is false for themCheck Is payroll in their run: it should be true
The expression won't saveA missing bracket or commaCount the brackets; Code view shows the saved text

FAQ​

Can or() take more than two conditions?​

Yes: or(a, b, c) is true when any of the three is. The reference's form ends with ... for that reason.

Can I mix or() and and()?​

Yes, by putting one inside the other: and(a, or(b, c)) is true when a is true and at least one of b and c is.

Does or() stop at the first true condition?​

The reference doesn't say. Write each condition so it works on its own, whatever the others are.

Conclusion​

or(condition1, condition2, ...) is true when at least one condition is. Write each condition on its own first, then join them; here, or() in a Filter array gave payroll staff every entry and approvers only their own departments'.

Additional Resources​