Power Automate

Power Automate Expressions: Six Patterns Worth Learning

Use six practical Power Automate expression patterns for text, dates, arrays and null values, with tested examples and the common mistakes to avoid.

Collab365 Team · Published 30 March 2026 · Refreshed 24 August 2026 · 2 min read

You will not master Power Automate expressions in 60 seconds. You can, however, learn six patterns that solve a surprising amount of real flow work.

Microsoft's current expression cookbook for cloud flows and the underlying workflow function reference are the sources of truth.

1. Split text into an array

split(variables('Emails'), ';')

This turns a semicolon-separated string into an array. Spaces are preserved, so trim items before using them if the input contains ; .

2. Replace part of a string

replace(variables('FileName'), '/', '-')

replace() is case-sensitive. Normalise both sides with toLower() when case should not matter.

3. Read part of a string

substring(variables('Reference'), 1, 1)

The start index is zero-based and the third argument is a length, not an end position. Check the input length first or a short value can fail the action.

4. Test whether text contains a value

contains(toLower(triggerBody()?['subject']), 'urgent')

This pattern provides a case-insensitive check. Do not use a loose keyword match where a false positive could trigger a destructive or external action.

5. Work with UTC safely

formatDateTime(utcNow(), 'yyyy-MM-dd HH:mm')

utcNow() returns UTC. Convert the time zone before showing a local time to people. Also remember that MM means month while mm means minutes.

6. Provide a null fallback

coalesce(triggerBody()?['Title'], 'Untitled')

The question mark is the null-safe property operator. coalesce() returns the first non-null value, but an empty string is not necessarily null. Use empty() when blank values also matter.

A safer way to build expressions

  1. Add a Compose action.
  2. Put one expression in it.
  3. Run the flow with a normal value, a blank value and a malformed value.
  4. Inspect the Compose input and output in run history.
  5. Only then move the expression into the production action.

This isolates data-shape problems from connector problems. It also gives the next maintainer something observable to test.

Common mistakes include copying an internal action name from a different flow, assuming date text uses the same regional format everywhere, calling substring() without checking length and passing an object where a string is expected.

Expressions become manageable when each one has a single job and a test case. If a formula becomes a paragraph, split it into Compose, Select or Filter array actions with meaningful names.

Bring a troublesome expression and its real input shape to Power Automate Builders.