Condition: branching on contract value
1. Condition: branching on contract value
A working flow does the same thing for every record. A useful flow branches. The most common branch in Power Automate is a Condition - and the most common bug is comparing a string to a number without realizing it.2. The Condition action, in one sentence
The Condition action takes one boolean expression and splits the flow in two. If the expression evaluates to true, the If yes branch runs; if false, the If no branch runs. That's the whole mental model. The expression is usually a comparison, like contract value is greater than 100,000, built from dynamic content, an operator, and a literal. Whatever happens inside each branch is just more actions, indented underneath. Conditions can nest, but past two levels deep you should reach for Switch instead.3. Conditions inside Apply to Each
Most real branching lives inside an Apply to Each. You've already got a list of contracts coming back from List rows, you're iterating, and on each pass you want to ask a question about this contract. Drop the Condition inside the loop body, after whatever per-row setup you need, and Power Automate re-evaluates the expression on every iteration. One $250,000 contract takes the If yes branch; the next $40,000 contract takes the If no branch. Same loop, two different outcomes, no extra logic required.4. The string-vs-number gotcha
Here's the bug that wastes more debugging hours than any other in Power Automate. Numeric columns sometimes arrive in dynamic content as strings, not numbers. When you compare a string to a number, Power Automate falls back to lexicographic comparison, character by character. Under those rules, `'250000.00'` is less than `'100000'`, because the character `1` comes before the character `2`. Your Condition takes the wrong branch and the flow runs green. The fix is to wrap the dynamic content with `int()` or `float()` so the comparison is genuinely numeric.5. Writing the expression
Inside a For Each, the current row is referenced as `items('For each')`, and a column on that row is `items('For each')['columnname']`. Wrap the whole thing in `int()` to force a numeric type, like `int(item()?['contractvalue'])`, then pick is greater than as the operator, and put the literal `100000` on the right side. That's the entire expression. Two branches underneath, one for the high-value path that escalates, one for the standard renewal path. The `int()` is the line that prevents the silent-wrong-branch failure.6. AND, OR, and grouping
Real branching rarely hangs on a single comparison. The Condition action lets you add multiple rows and pick AND or OR as the grouping mode. AND means every row has to be true for the branch to fire; OR means at least one row is enough. You can nest groups too. (value over 100k AND status is Active) OR (flagged as priority) is one Condition with two grouped rows joined by OR. When you're not sure which operator you need, read the requirement aloud. And versus or in plain English usually maps directly to the operator.7. Let's practice!
Time to add a Condition and route high-value contracts.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.