Cookbook
Power Automate Expressions Cookbook
Expression recipes for dates, arrays, trigger conditions, null handling, email formatting, and safe data shaping.
Power Automate expressionstrigger conditionsSelect actionformatDateTime
Who this helps
Flow builders who need reliable expressions they can adapt without breaking production runs.
What to standardize
- Normalize dates, text, arrays, and null values early.
- Move repeated transformations into named Compose or Select steps.
- Pair expressions with run-after scopes.
- Keep trigger conditions small and documented.
Examples
Format a due date
Turn a raw date into a readable email value.
Formula / code
formatDateTime(triggerOutputs()?['body/DueDate'], 'MMM d, yyyy')Expected result: The email shows a clean date such as May 16, 2026.
Common mistakes
- Formatting null dates
- Mixing regional formats
- Putting long expressions directly in emails
Safe null fallback
Avoid failed expressions when optional fields are blank.
Formula / code
coalesce(triggerOutputs()?['body/ReviewerNotes'], 'No reviewer notes were entered.')Expected result: The flow continues with a useful fallback value.
Common mistakes
- Assuming every field has a value
- Testing only the happy path
- Using empty string checks only