100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Conditions and Branching

How the Condition and Switch actions let a flow evaluate expressions and branch execution down different paths.

Control & DataBeginner8 min readJul 10, 2026
Analogies

Understanding Conditions and Branching

A Power Automate flow becomes intelligent the moment it can make a decision, and the Condition action is the primary tool for that. It evaluates a single logical expression against dynamic content from earlier steps and splits execution into a Yes branch and a No branch, so only one path runs depending on the outcome.

🏏

Cricket analogy: It's like a captain deciding whether to review an umpire's decision: if replays show the ball clipped the bails, the DRS branch confirms out, otherwise the batter stays — only one outcome plays out.

Building Conditions with the Condition Action

Configuring a Condition means picking a value from dynamic content, choosing an operator such as is equal to, is greater than, or contains, and supplying a comparison value. Multiple conditions can be grouped with AND or OR logic, and switching to Advanced mode lets you write the raw expression directly, such as @and(equals(...), greater(...)).

🏏

Cricket analogy: It's like setting selection criteria for a T20 squad: a bowler needs an economy rate under 7 AND a strike rate under 20 to make the final XI — both conditions must hold.

Working with Expressions and Dynamic Content

Conditions frequently reference nested JSON from a trigger or a previous action, and the safest way to do that is with the null-safe accessor, such as triggerOutputs()?['body/Status'], which returns null instead of throwing an error if the property is missing. Wrapping comparisons in equals(), greater(), or not() inside an Advanced-mode expression gives far more control than the simple UI picker.

🏏

Cricket analogy: It's like checking a scorecard field that might not exist yet for a match still in progress — you query 'current partnership' defensively rather than assuming it's already populated.

Switch Actions for Multi-Branch Logic

When a flow needs to branch on more than two outcomes for the same value, nesting multiple Condition actions becomes hard to read and maintain. The Switch action solves this by evaluating one expression once and matching it against several Case values, each with its own set of actions, plus a Default case that catches anything unmatched.

🏏

Cricket analogy: It's like a match-status handler that reacts differently to 'Won', 'Lost', 'Tied', or 'No Result' — a Switch on one field instead of four nested Condition checks.

json
{
  "type": "If",
  "expression": {
    "and": [
      { "equals": ["@triggerBody()?['Status']", "Approved"] },
      { "greater": ["@triggerBody()?['Amount']", 1000] }
    ]
  },
  "actions": {
    "true": "Send high-value approval email",
    "false": "Send standard approval email"
  }
}

Use the null-safe accessor (?[ ]) inside Advanced-mode expressions — for example triggerBody()?['Status'] — so the flow returns null instead of throwing an error when a field is missing from the payload, which matters most on optional fields from webhook triggers.

String comparisons in equals() are case-sensitive, so equals(triggerBody()?['Status'], 'approved') will not match 'Approved'. Normalize casing with toLower() on both sides of the comparison if the source system's casing isn't guaranteed.

  • The Condition action evaluates one expression and splits execution into Yes/No branches.
  • Advanced mode exposes the raw expression (@equals, @and, @or, @not) for full control beyond the UI picker.
  • Use the null-safe accessor ?[ ] when referencing properties that might be missing from dynamic content.
  • The Switch action replaces multiple nested Conditions when branching on one value with 3+ outcomes, plus a Default case.
  • String comparisons via equals() are case-sensitive; normalize with toLower() when source casing varies.
  • Deeply nested Conditions hurt readability and can be replaced with Switch or a child flow.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#PowerAutomateStudyNotes#ConditionsAndBranching#Conditions#Branching#Building#Condition#Git#StudyNotes#SkillVeris