Power Automate Expression Builder
Browse, search, and copy 40+ Power Automate expressions with syntax, examples, and usage tips. 100% free — bookmark this page for quick reference.
Category
Showing 61 expressions
concatStringCombines two or more strings into one.
concat('str1', 'str2', ...)concat('Hello', ' ', 'World') → 'Hello World'substringStringReturns a portion of a string starting at the specified position.
substring('text', startIndex, length)substring('Hello World', 6, 5) → 'World'replaceStringReplaces all occurrences of a substring with a new value.
replace('text', 'old', 'new')replace('Hello World', 'World', 'Power Automate') → 'Hello Power Automate'toLowerStringConverts a string to all lowercase characters.
toLower('text')toLower('HELLO') → 'hello'toUpperStringConverts a string to all uppercase characters.
toUpper('text')toUpper('hello') → 'HELLO'trimStringRemoves leading and trailing whitespace from a string.
trim('text')trim(' hello ') → 'hello'indexOfStringReturns the starting position of a substring. Returns -1 if not found.
indexOf('text', 'search')indexOf('Hello World', 'World') → 6startsWithStringChecks whether a string starts with the specified substring.
startsWith('text', 'prefix')startsWith('Hello World', 'Hello') → trueendsWithStringChecks whether a string ends with the specified substring.
endsWith('text', 'suffix')endsWith('Hello World', 'World') → truesplitStringSplits a string into an array using the specified delimiter.
split('text', 'delimiter')split('a,b,c', ',') → ['a','b','c']lengthStringReturns the number of characters in a string or items in an array.
length('text')length('Hello') → 5guidStringGenerates a globally unique identifier (GUID) string.
guid()guid() → 'c2ecc88d-88c8-4096-912c-d6f2e2b138ce'utcNowDate / TimeReturns the current UTC timestamp. Optionally formatted.
utcNow('format')utcNow('yyyy-MM-dd') → '2026-03-08'formatDateTimeDate / TimeFormats a date/time value using the specified format string.
formatDateTime('timestamp', 'format')formatDateTime('2026-03-08T10:00:00Z', 'dd/MM/yyyy') → '08/03/2026'addDaysDate / TimeAdds the specified number of days to a timestamp.
addDays('timestamp', days, 'format')addDays('2026-03-08', 7) → '2026-03-15'addHoursDate / TimeAdds the specified number of hours to a timestamp.
addHours('timestamp', hours, 'format')addHours('2026-03-08T10:00:00Z', 3) → '2026-03-08T13:00:00Z'addMinutesDate / TimeAdds the specified number of minutes to a timestamp.
addMinutes('timestamp', minutes, 'format')addMinutes('2026-03-08T10:00:00Z', 30) → '2026-03-08T10:30:00Z'convertTimeZoneDate / TimeConverts a timestamp from one time zone to another.
convertTimeZone('timestamp', 'sourceZone', 'destZone', 'format')convertTimeZone(utcNow(), 'UTC', 'Eastern Standard Time', 'yyyy-MM-dd HH:mm')dayOfWeekDate / TimeReturns the day of the week (0 = Sunday, 6 = Saturday).
dayOfWeek('timestamp')dayOfWeek('2026-03-08') → 0dayOfMonthDate / TimeReturns the day of the month component.
dayOfMonth('timestamp')dayOfMonth('2026-03-08') → 8ticksDate / TimeReturns the ticks (100-nanosecond intervals since 01/01/0001).
ticks('timestamp')ticks('2026-03-08T00:00:00Z') → 638793...firstCollectionReturns the first item from an array or first character of a string.
first(collection)first(createArray(1,2,3)) → 1lastCollectionReturns the last item from an array or last character of a string.
last(collection)last(createArray(1,2,3)) → 3containsCollectionChecks whether an array contains a value, or a string contains a substring.
contains(collection, value)contains('Hello World', 'World') → trueemptyCollectionChecks whether a collection, string, or object is empty.
empty(collection)empty('') → truejoinCollectionJoins all items in an array into a single string with a delimiter.
join(collection, 'delimiter')join(createArray('a','b','c'), ', ') → 'a, b, c'createArrayCollectionCreates an array from the specified items.
createArray(item1, item2, ...)createArray(1, 2, 3) → [1, 2, 3]unionCollectionReturns a collection that has all items from the specified collections (no duplicates).
union(collection1, collection2)union(createArray(1,2), createArray(2,3)) → [1,2,3]intersectionCollectionReturns a collection that has only the common items across the specified collections.
intersection(collection1, collection2)intersection(createArray(1,2,3), createArray(2,3,4)) → [2,3]ifLogicalReturns one of two values based on whether a condition is true or false.
if(condition, valueIfTrue, valueIfFalse)if(equals(1,1), 'yes', 'no') → 'yes'equalsLogicalChecks whether both values are equal. Returns true or false.
equals(value1, value2)equals(1, 1) → trueandLogicalReturns true only if all expressions are true.
and(expr1, expr2)and(equals(1,1), equals(2,2)) → trueorLogicalReturns true if at least one expression is true.
or(expr1, expr2)or(equals(1,2), equals(2,2)) → truenotLogicalReturns the opposite boolean value.
not(expression)not(true) → falsegreaterLogicalReturns true if the first value is greater than the second.
greater(value1, value2)greater(10, 5) → truelessLogicalReturns true if the first value is less than the second.
less(value1, value2)less(5, 10) → truecoalesceLogicalReturns the first non-null value from the arguments.
coalesce(value1, value2, ...)coalesce(null, '', 'fallback') → ''intConversionConverts a string to an integer.
int('value')int('42') → 42floatConversionConverts a string to a floating-point number.
float('value')float('3.14') → 3.14stringConversionConverts a value to its string representation.
string(value)string(42) → '42'boolConversionConverts a value to a boolean.
bool('value')bool(1) → truejsonConversionParses a JSON string into an object or array.
json('jsonString')json('{"name":"Riz"}') → { name: "Riz" }base64ConversionEncodes a string to its Base64 representation.
base64('value')base64('Hello') → 'SGVsbG8='base64ToStringConversionDecodes a Base64 string back to a plain string.
base64ToString('base64')base64ToString('SGVsbG8=') → 'Hello'uriComponentConversionEncodes a string for safe use in a URL.
uriComponent('value')uriComponent('hello world') → 'hello%20world'addMathReturns the sum of two numbers.
add(num1, num2)add(10, 5) → 15subMathReturns the result of subtracting the second number from the first.
sub(num1, num2)sub(10, 5) → 5mulMathReturns the product of two numbers.
mul(num1, num2)mul(3, 4) → 12divMathReturns the integer result of dividing two numbers.
div(num1, num2)div(10, 3) → 3modMathReturns the remainder from dividing two numbers.
mod(num1, num2)mod(10, 3) → 1minMathReturns the smallest value from a set of numbers or an array.
min(num1, num2, ...)min(1, 5, 3) → 1maxMathReturns the largest value from a set of numbers or an array.
max(num1, num2, ...)max(1, 5, 3) → 5randMathReturns a random integer between the specified min (inclusive) and max (exclusive).
rand(minValue, maxValue)rand(1, 100) → 42triggerBodyReferencingReturns the trigger's body output at runtime.
triggerBody()triggerBody()?['value'] → trigger payloadtriggerOutputsReferencingReturns the trigger's output at runtime.
triggerOutputs()triggerOutputs()?['headers'] → trigger headersbodyReferencingReturns an action's body output at runtime.
body('actionName')body('Get_items')?['value'] → items arrayoutputsReferencingReturns an action's full output at runtime.
outputs('actionName')outputs('Send_email')?['statusCode'] → 200itemsReferencingReturns the current item in an Apply to each loop.
items('loopName')items('Apply_to_each')?['Title'] → current item titlevariablesReferencingReturns the value of a specified variable.
variables('varName')variables('myCounter') → 5parametersReferencingReturns a workflow parameter value.
parameters('paramName')parameters('siteUrl') → 'https://contoso.sharepoint.com'workflowReferencingReturns details about the workflow itself at runtime.
workflow()workflow()?['run']?['name'] → run IDWhat are Power Automate Expressions?
Power Automate expressions are formulas used inside Microsoft Power Automate (formerly Microsoft Flow) to transform data, perform calculations, and control workflow logic. They are similar to Excel formulas but designed for cloud-based automation.
When to Use Expressions
- Data transformation — format dates, manipulate strings, convert types
- Conditional logic — use
if(),equals(),and()to branch workflows - Dynamic content — reference trigger data, action outputs, and variables
- Date arithmetic — add days, convert time zones, format timestamps
- Collections — filter arrays, join items, check for values
Tips for Writing Expressions
- Always wrap string literals in single quotes:
'Hello' - Use the ? operator for null-safe property access:
body('action')?['value'] - Chain functions by nesting them:
toLower(trim(triggerBody()?['email'])) - Use
coalesce()to provide fallback values for potentially null fields - Test expressions in a Compose action before using them in production flows
Frequently Asked Questions
What are Power Automate expressions?
Expressions are formulas (similar to Excel) used in Power Automate flows to manipulate data, format dates, convert arrays, and handle logic.
Where do I enter expressions in my flow?
Click any input field in a flow action, switch to the "Expression" tab in the dynamic content pane, and paste your formula.
Why does my expression return null?
If an expression references a missing property, it will return null. Use the coalesce() function to provide a fallback value.