Introduction
Power Automate expressions are formulas used in Microsoft Power Automate flows to manipulate data, apply logic, and control automation behavior dynamically.
They allow you to build smarter, more flexible automation flows by working with:
Text (strings)
Numbers
Dates and times
Arrays
Objects
Logical conditions
Why Expressions Matter
Expressions make your flows dynamic and intelligent. For example:
Automatically format dates in emails
Check if a field is empty before proceeding
Combine multiple values into a single string
Calculate due dates
Extract part of a filename
Handle null values safely
Without expressions, flows would be limited to simple, static automation.
Where Expressions Are Used
In Power Automate, expressions can be added in:
They are written using a function-style syntax like:
functionName(parameter1, parameter2)
Example:
concat('Hello ', triggerBody()?['FirstName'])
How Expressions Work
Expressions:
Are case-sensitive
Use parentheses ()
Accept values, variables, or other expressions as parameters
Can be nested inside each other
Example of nesting:
if(equals(length('Power'),5),'Correct','Incorrect')
In short, expressions are the logic engine behind smart automation in Power Automate.
🔤 String Functions
| Expression | Description | Example |
|---|
concat(a, b, ...) | Combine multiple strings | concat('Flow','-','CheatSheet') → "Flow-CheatSheet" |
substring(text, start, length) | Return part of a string | substring('PowerAutomate',0,5) → "Power" |
length(text) | Number of characters | length('Functions') → 9 |
split(text, delim) | Split string into array | split('A,B,C',',') → ['A','B','C'] |
toLower(text) | Convert to lowercase | toLower('Hello') → "hello" |
trim(text) | Remove leading/trailing spaces | trim(' ABC ') → "ABC" |
replace(text, old, new) | Replace substring | replace('one two',' ','-') → "one-two" |
indexOf(text, value) | First position of value | indexOf('abcde','c') → 2 |
lastIndexOf(text, value) | Last position of value | lastIndexOf('abcabc','c') → 5 |
startsWith(text, value) | Check prefix | startsWith('Hello','He') → true |
📦 Collection / Array Functions
| Expression | Description | Example |
|---|
join(array, delim) | Join array elements | join(['a','b','c'],'-') → "a-b-c" |
first(array) | First element | first(['One','Two']) → "One" |
last(array) | Last element | last(['One','Two']) → "Two" |
union(a,b) | Combine arrays (unique values) | union(array1,array2) |
intersection(a,b) | Common elements | intersection(array1,array2) |
contains(array,item) | Check if array contains item | contains(['a','b'],'b') → true |
length(array) | Count items | length(['a','b','c']) → 3 |
🔀 Logical & Conditional Functions
| Expression | Description | Example |
|---|
if(cond, valT, valF) | Conditional logic | if(equals(1,1),'match','no match') → "match" |
equals(a,b) | Equality check | equals(2,2) → true |
greater(a,b) | Greater than | greater(5,3) → true |
less(a,b) | Less than | less(2,4) → true |
and(a,b,...) | Logical AND | and(true,false) → false |
or(a,b,...) | Logical OR | or(true,false) → true |
not(value) | Logical NOT | not(true) → false |
empty(value) | Check if empty | empty('') → true |
coalesce(a,b,...) | First non-null value | coalesce(null,'default') → "default" |
📅 Date & Time Functions
| Expression | Description | Example |
|---|
utcNow() | Current UTC date/time | utcNow() |
addDays(date,n) | Add days | addDays('2025-10-01',2) → "2025-10-03" |
addHours(date,n) | Add hours | addHours('2025-10-26T10:00:00Z',3) |
formatDateTime(date,fmt) | Format date | formatDateTime('2025-10-26','yyyy-MM-dd') |
dayOfWeek(date) | Day index (0=Sunday) | dayOfWeek('2025-10-26') → 0 |
Conclusion
Expressions in Power Automate allow you to manipulate data, perform calculations, and control logic dynamically, making workflows more flexible and efficient. They are essential for transforming inputs and automating complex tasks without manual intervention.