← Back to Blog

Power Automate Expressions Cheat Sheet: 50+ Functions with Examples (2026)

Quick-reference Power Automate expressions cheat sheet — string, date, array, and logic functions with real examples.

Power Automate Expressions Cheat Sheet: 50+ Functions with Examples (2026)


Why You Need This Cheat Sheet

Power Automate expressions are the difference between a basic flow and one that actually handles real-world data. Without them, you are stuck with static values and rigid logic. With them, you can parse dates, manipulate strings, handle nulls, and build dynamic content on the fly.

You write expressions in the expression editor -- click any input field in your flow, select the "Expression" tab, type your function, and hit OK. Every expression starts with a function name and returns a value that gets inserted into that field.

This cheat sheet covers every function you are likely to need, organized by category with copy-paste examples.

---

String Functions

FunctionSyntaxExampleOutput
concatconcat(text1, text2, ...)concat('Hello', ' ', 'World')Hello World
substringsubstring(text, startIndex, length)substring('PowerAutomate', 5, 8)Automate
replacereplace(text, oldText, newText)replace('Hello World', 'World', 'Flow')Hello Flow
splitsplit(text, delimiter)split('a;b;c', ';')["a","b","c"]
toLowertoLower(text)toLower('HELLO')hello
toUppertoUpper(text)toUpper('hello')HELLO
trimtrim(text)trim(' hello ')hello
indexOfindexOf(text, searchText)indexOf('Hello World', 'World')6
lengthlength(text)length('Power')5
startsWithstartsWith(text, searchText)startsWith('PowerAutomate', 'Power')true
endsWithendsWith(text, searchText)endsWith('report.pdf', '.pdf')true
containscontains(text, searchText)contains('Hello World', 'World')true
formatNumberformatNumber(number, format)formatNumber(1234.5, 'C2')$1,234.50

String Tips

Use concat() instead of the @{...} inline syntax when you need to combine more than two dynamic values -- it is easier to debug. When checking user input, always wrap the value in toLower() or toUpper() first so your comparisons are case-insensitive.

---

Date and Time Functions

FunctionSyntaxExampleOutput
utcNowutcNow(format?)utcNow('yyyy-MM-dd')2026-04-03
addDaysaddDays(timestamp, days, format?)addDays(utcNow(), 7, 'yyyy-MM-dd')7 days from now
addHoursaddHours(timestamp, hours, format?)addHours(utcNow(), -3)3 hours ago
addMinutesaddMinutes(timestamp, minutes)addMinutes(utcNow(), 30)30 min from now
formatDateTimeformatDateTime(timestamp, format)formatDateTime(utcNow(), 'MM/dd/yyyy')04/03/2026
convertTimeZoneconvertTimeZone(timestamp, source, dest, format?)convertTimeZone(utcNow(), 'UTC', 'Eastern Standard Time', 'hh:mm tt')08:30 AM
dayOfWeekdayOfWeek(timestamp)dayOfWeek('2026-04-03')5 (Friday)
dayOfMonthdayOfMonth(timestamp)dayOfMonth('2026-04-03')3
ticksticks(timestamp)ticks('2026-01-01')Tick count
dateDifferencedateDifference(startDate, endDate)dateDifference('2026-01-01', '2026-04-03')92.00:00:00

Date Tips

The formatDateTime() function uses .NET custom date format strings. Common patterns: yyyy-MM-dd for ISO, MM/dd/yyyy for US, dd/MM/yyyy for EU, and dddd, MMMM d, yyyy for display (e.g., "Friday, April 3, 2026"). Always convert to the user's time zone with convertTimeZone() before displaying dates in emails.

---

Collection and Array Functions

FunctionSyntaxExampleOutput
firstfirst(collection)first(createArray('a','b','c'))a
lastlast(collection)last(createArray('a','b','c'))c
lengthlength(collection)length(createArray('a','b','c'))3
containscontains(collection, value)contains(createArray('a','b'), 'b')true
joinjoin(collection, delimiter)join(createArray('a','b','c'), '; ')a; b; c
splitsplit(text, delimiter)split('a,b,c', ',')["a","b","c"]
unionunion(collection1, collection2)union(createArray(1,2), createArray(2,3))[1,2,3]
intersectionintersection(col1, col2)intersection(createArray(1,2,3), createArray(2,3,4))[2,3]
skipskip(collection, count)skip(createArray('a','b','c'), 1)["b","c"]
taketake(collection, count)take(createArray('a','b','c'), 2)["a","b"]
createArraycreateArray(item1, item2, ...)createArray(1, 2, 3)[1,2,3]

Array Tips

Use empty() to check if an array has items before looping. Combine skip() and take() for pagination. The union() function also works to merge two objects (not just arrays), which is useful for building dynamic JSON payloads.

---

Logical Functions

FunctionSyntaxExampleOutput
ifif(expression, valueIfTrue, valueIfFalse)if(equals(1,1), 'yes', 'no')yes
equalsequals(value1, value2)equals(toLower('Hello'), 'hello')true
andand(expr1, expr2)and(greater(5,3), less(5,10))true
oror(expr1, expr2)or(equals(1,2), equals(1,1))true
notnot(expression)not(equals(1,2))true
greatergreater(value1, value2)greater(10, 5)true
greaterOrEqualsgreaterOrEquals(value1, value2)greaterOrEquals(5, 5)true
lessless(value1, value2)less(3, 5)true
lessOrEqualslessOrEquals(value1, value2)lessOrEquals(5, 5)true
emptyempty(value)empty('')true
coalescecoalesce(value1, value2, ...)coalesce(null, null, 'default')default

Logic Tips

You cannot nest if() more than a few levels deep before it becomes unreadable. If you need complex branching, use a Condition or Switch action instead. The coalesce() function is your best friend for handling null values from SharePoint or Dataverse -- it returns the first non-null value in the list.

---

Conversion Functions

FunctionSyntaxExampleOutput
intint(value)int('42')42
floatfloat(value)float('3.14')3.14
stringstring(value)string(42)"42"
boolbool(value)bool(1)true
jsonjson(value)json('{"name":"test"}')JSON object
xmlxml(value)xml('1')XML object
base64base64(value)base64('Hello')SGVsbG8=
base64ToStringbase64ToString(value)base64ToString('SGVsbG8=')Hello
decodeBase64decodeBase64(value)decodeBase64('SGVsbG8=')Hello
uriComponenturiComponent(value)uriComponent('hello world')hello%20world
decodeUriComponentdecodeUriComponent(value)decodeUriComponent('hello%20world')hello world

---

Common Patterns

These are the expressions you will copy-paste most often in production flows.

Format a Date as MM/dd/yyyy

When SharePoint returns an ISO timestamp and you need a clean date for an email:

formatDateTime(triggerOutputs()?['body/Created'], 'MM/dd/yyyy')

For a friendly format like "April 3, 2026":

formatDateTime(triggerOutputs()?['body/Created'], 'MMMM d, yyyy')

Get File Extension from a Filename

Extract the extension from a file name dynamic value:

last(split(triggerOutputs()?['body/{FilenameWithExtension}'], '.'))

This splits report-final.pdf by the dot and returns pdf.

Null-Safe Field Access

SharePoint People columns and lookup columns return null when empty. Wrap them with coalesce() to avoid flow failures:

coalesce(triggerOutputs()?['body/Manager/Email'], 'no-manager@contoso.com')

For numeric fields that might be null:

coalesce(triggerOutputs()?['body/Amount'], 0)

Build a Dynamic Email Subject

Combine multiple fields into a subject line for approval emails:

concat('[', triggerOutputs()?['body/Department'], '] ', triggerOutputs()?['body/RequestType'], ' - ', triggerOutputs()?['body/Title'])

Output: [Finance] Purchase Order - Office Supplies Q2

For more on building approval flows, see the full guide at Power Automate Document Approval Workflow.

Calculate Business Days Between Two Dates

There is no built-in business days function. Use dateDifference() to get total days, then account for weekends with this approach:

div(mul(div(sub(ticks(outputs('EndDate')), ticks(outputs('StartDate'))), 864000000000), 5), 7)

This calculates a rough estimate. For exact results accounting for holidays, store holiday dates in a SharePoint list and loop through them.

Parse JSON from an HTTP Response

When calling an external API with the HTTP action, parse the response body:

json(body('HTTP_Request'))?['results']

To safely access a nested property:

coalesce(json(body('HTTP_Request'))?['data']?['value'], 'Not found')

---

Quick Reference: Expression Editor Shortcuts

A few things that trip up new users:

  • Accessing dynamic content in expressions: Use triggerOutputs(), outputs('ActionName'), or body('ActionName') to reference values.

  • Optional chaining: The ? operator (e.g., body('Get_item')?['value']) prevents errors when a property does not exist.

  • Nested quotes: Use single quotes inside expressions. Double quotes break the parser.

  • Testing expressions: Use a Compose action to test any expression -- the output shows exactly what it returns.

For styled HTML output in your flow emails, check out Power Automate HTML Table Styling with CSS. You can also try our interactive Power Automate Expressions Tool to test functions directly in the browser.

---

FAQ

What is the difference between concat() and formatString()?

concat() joins values end-to-end: concat('Hello', ' ', 'World') returns Hello World. You can pass any number of arguments. There is no separate formatString() in Power Automate -- use concat() for all string building, or use inline expressions with @{...} syntax directly in action inputs for simpler cases.

Can you nest expressions inside other expressions?

Yes, and you will do this constantly. For example, if(empty(triggerOutputs()?['body/Email']), 'N/A', toLower(triggerOutputs()?['body/Email'])) checks if a field is empty before transforming it. Just be careful with parentheses -- one missing closing paren and the whole expression fails with a cryptic error.

How do you handle time zones in Power Automate?

Always use convertTimeZone() before displaying dates to users. Power Automate stores all timestamps in UTC internally. The function takes the timestamp, source zone (usually 'UTC'), destination zone (e.g., 'Eastern Standard Time'), and an optional format string. You can find the full list of supported time zone names in the Microsoft documentation.

Why does my expression return an error about "InvalidTemplate"?

This usually means one of three things: a syntax error (check your parentheses and single quotes), a type mismatch (you are passing a string where a number is expected -- use int() or float() to convert), or a null reference (the dynamic content you are referencing does not exist at runtime -- wrap it in coalesce()).

Free Developer Tool

Power Automate Expressions

Stop Googling expression syntax. Browse, search, and copy every Power Automate formula with real-world examples — free.

Try It Free →