Skip to main content

How to Combine Conditions in Power Apps with And and Or

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

Most real conditions have more than one part: this job title and still active, not loading and nothing to show. And is true only when all parts are true; Or is true when any part is.

Three Ways to Write Them​

FunctionOperatorAlso allowed
And( a, b )a && ba And b
Or( a, b )a || ba Or b
Not( a )!aNot a

All three forms work the same (And, Or, and Not functions). They take true-or-false values, so each part is a comparison or a test, such as x > 1 or IsEmpty(t). Not has its own guide: How to Use Not in Power Apps.

Example 1: And in a SharePoint Filter​

The Career Development Plan app shows the competencies that are for the person's job title and still active:

Part of My Plan Screen → OnVisible
Filter(RoleCompetencies, JobTitle = MyJobTitle && IsActive)

Inside Filter, separating conditions with commas does the same: all must be true (How to Filter a Table in Power Apps with Filter).

Example 2: And in a Visible Property​

A "no plan yet" message shows only when the screen has finished loading and there are no competencies:

lblEmptyMPS → Visible
!locIsLoading && IsEmpty(locMyPlan)

The formula bar with !locIsLoading && IsEmpty(locMyPlan) in the Visible property of lblEmptyMPS, the preview strip showing the IsEmpty part as true, and the message visible on the canvas

With the cursor on one part, the preview strip shows that part's value, here IsEmpty(locMyPlan) = true. That's a quick way to find which part of a long condition is false.

Example 3: Or​

While designing the same screen, the gallery temporarily showed two job titles' competencies at once:

galMyPlanMPS → Items (temporary)
Filter(RoleCompetencies, JobTitle = "Sales Engineer" || JobTitle = "Head of Sales")

It returned the two Sales Engineer competencies and the three for Head of Sales.

Delegation​

For SharePoint, Microsoft says expressions joined with And or Or are delegable, and Not isn't (SharePoint delegation). Each part still has to be delegable on its own. See What Is Delegation in Power Apps?

Common Mistakes​

MistakeWhat happensDo this instead
& instead of &&& joins text, so the result isn't a true-or-false valueUse &&
Mixing && and || without bracketsThe parts group differently from what you meantAdd brackets: a && (b || c)
JobTitle = "A" || "B"The second part isn't a comparisonJobTitle = "A" || JobTitle = "B"

Troubleshooting​

SymptomLikely causeFix
The condition is never trueOne part is always falsePut the cursor on each part and read the preview strip
A delegation warning with NotNot can't be delegated to SharePointRewrite it, for example IsActive = false

FAQ​

&& or And?​

They're the same. This series uses && and ||, the JavaScript-style operators Microsoft lists alongside the words.

Can I use them in If?​

Yes, anywhere a true-or-false value goes: If(a && b, "both", "not both") (How to Use the If Function in Power Apps).

Conclusion​

a && b is true when both are true, a || b when either is. Use them in filters, Visible and If conditions, and check each part with the preview strip.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.