Introduction

Power Automate expressions are essential for building dynamic, flexible, and intelligent workflows. While the visual designer makes flow creation easy, real-world business scenarios often require expressions to handle conditions, calculations, formatting, and data transformations.

This article explains commonly used Power Automate expressions, why they are needed, and how to use them, with practical examples you can apply immediately in your flows.

What Are Power Automate Expressions?

Power Automate expressions are formulas written in Workflow Definition Language (WDL). They allow you to:

  • Manipulate and transform data

  • Perform calculations

  • Apply conditional logic

  • Format text and date values

  • Work with arrays and objects

Expressions are commonly used in:

  • Condition actions

  • Compose actions

  • Initialize / Set Variable actions

  • Dynamic content fields

Expressions are always written inside:

Code
@{ }

1. concat() – Combine Text Values

Purpose: Combines multiple text values into a single string.

Syntax

Code
concat(value1, value2, value3)

Example

Code
concat('Leave request from ', triggerBody()?['EmployeeName'])

Output

Code
Leave request from John Doe

Common Use Cases

  • Email subject lines

  • File and folder names

  • Dynamic notification messages

2. equals() – Compare Two Values

Purpose

Checks whether two values are equal.

Syntax

Code
equals(value1, value2)

Example

Code
equals(triggerBody()?['Status'], 'Approved')

Output

  • true if values match

  • false otherwise

Common Use Cases

  • Condition checks

  • Approval and decision flows

3. if() – Conditional Logic

Purpose

Returns one value if the condition is true and another if it is false.

Syntax

Code
if(condition, valueIfTrue, valueIfFalse)

Example

Code
if(equals(triggerBody()?['Priority'], 'High'), 'Urgent', 'Normal')

Output

Code
Urgent

or

Code
Normal

Common Use Cases

  • Conditional email content

  • Status labels

  • Priority-based logic

4. empty() – Check for Blank or Null Values

Purpose

Checks whether a value is null or empty.

Syntax

Code
empty(value)

Example

Code
empty(triggerBody()?['Comments'])

Output

  • true if empty or null

  • false if value exists

Best Practice

Always use empty() instead of direct null comparisons to avoid runtime errors.

5. coalesce() – Handle Null Values Safely

Purpose

Returns the first non-null value from a list.

Syntax

Code
coalesce(value1, value2, value3)

Example

Code
coalesce(triggerBody()?['ManagerEmail'], '[email protected]')

Output

  • Manager email if available

  • Default email otherwise

Common Use Cases

  • Optional fields

  • SharePoint and Dataverse null handling

6. formatDateTime() – Format Date and Time

Purpose

Formats date and time values into a readable format.

Syntax

Code
formatDateTime(date, format)

Example

Code
formatDateTime(triggerBody()?['Created'], 'dd-MMM-yyyy')

Output

Code
16-Dec-2025

Common Use Cases

  • Email content

  • Reports

  • File naming conventions

7. addDays(), addHours(), addMinutes() – Date Calculations

Purpose

Performs date and time calculations.

Syntax

Code
addDays(date, number)
addHours(date, number)
addMinutes(date, number)

Example

Code
addDays(utcNow(), 7)

Output

Code
Date after 7 days from today

Common Use Cases

  • SLA calculations

  • Reminder scheduling

  • Due date generation

8. length() – Get Count of Items

Purpose

Returns the number of characters in a string or items in an array.

Syntax

Code
length(value)

Example

Code
length(body('Get_items')?['value'])

Output

Code
Number of items retrieved

Common Use Cases

  • Record validation

  • Conditional branching

9. contains() – Check if Value Exists

Purpose

Checks whether a string or array contains a specific value.

Syntax

Code
contains(value, substring)

Example

Code
contains(triggerBody()?['Title'], 'Urgent')

Output

Code
true

or

Code
false

Common Use Cases

  • Keyword detection

  • Subject-based routing

10. split() – Convert Text into an Array

Purpose

Splits a string into multiple values using a delimiter.

Syntax

Code
split(string, delimiter)

Example

Code
split('IT,HR,Finance', ',')

Output

Code
["IT", "HR", "Finance"]

Common Use Cases

  • Multi-value processing

  • Loop creation

11. join() – Convert an Array into Text

Purpose

Combines array values into a single string.

Syntax

Code
join(array, delimiter)

Example

Code
join(variables('Departments'), ', ')

Output

Code
IT, HR, Finance

12. int(), string(), bool() – Type Conversion

Purpose

Converts values into required data types.

Examples

Code
int('10')
string(variables('Count'))
bool('true')

Common Use Cases

  • Mathematical operations

  • Condition comparisons

  • Data validation

Common Mistakes to Avoid

  • Comparing null values directly instead of using empty() or coalesce()

  • Forgetting to wrap expressions inside @{}

  • Using dynamic content instead of expressions inside conditions

  • Ignoring time zone conversions

Best Practices

  • Use Compose actions to test expressions

  • Keep expressions readable and simple

  • Add comments to explain complex logic

  • Avoid deeply nested expressions

  • Handle null values proactively

Conclusion

Mastering Power Automate expressions significantly improves the reliability, scalability, and maintainability of your workflows. The expressions covered in this article address most real-world automation scenarios and form a strong foundation for advanced Power Automate development.

With regular practice, expressions become a powerful asset rather than a challenge.