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 Power Automate expressions actually are
Expressions in Power Automate are not a bespoke formula language. They are the Workflow Definition Language, the same engine Azure Logic Apps runs on, which is why Logic Apps documentation answers Power Automate questions and why the function list is identical in both. Everything you type into the expression box is a function call over JSON: there are no statements, no assignment, and no loops. If you find yourself wanting those, the answer is an action, not a longer expression.
The most common failure: [ versus ?[
triggerBody()['Email'] and triggerBody()?['Email']behave identically right up until the property is missing, at which point the first throws and fails the run and the second returns null. An empty SharePoint column, an optional form field nobody filled in, a lookup that was cleared — each produces a property that is absent rather than empty. Flows built and tested against complete data fail weeks later on the first incomplete record. Use the null-safe ?[] accessor unless you specifically want a hard failure, and wrap the result in coalesce() when you need a default.
Action names are not what the designer shows you
References such as body('Get_items') and items('Apply_to_each')use the action's internal name, where every space becomes an underscore. The designer displays “Apply to each”; the expression needs Apply_to_each. Rename an action after writing expressions against it and every reference breaks — the flow saves without complaint and fails at run time with an unknown-action error. Settle on action names before you write expressions against them.
Time zones take Windows IDs, not IANA ones
convertFromUtc() and convertTimeZone()expect Windows time zone identifiers — Arabian Standard Time, India Standard Time, GMT Standard Time — not the IANA names (Asia/Qatar, Europe/London) that most other modern platforms use. An IANA string fails at run time rather than falling back to something sensible. The format string is ICU, and note thatMM is month while mm is minutes, which is the other dependable source of date bugs here.
Type coercion is stricter than it looks
int('') throws rather than returning zero, and so does int(null). A guarded conversion — if(empty(x), 0, int(x))— is the idiom worth learning early. Comparisons are typed too: equals(1, '1') is false, which matters when a value arrives as a string from an HTTP response and is compared against a number from a SharePoint column.
Working with collections without a loop
There is no filter() expression function. Filtering an array is the Filter array action and reshaping one is the Select action. The expression functions that do operate on collections are first(), last(), take(), skip(), union(), intersection(), join() and contains(). Reaching for an Apply to each purely to find one matching item is the most common performance mistake in Power Automate: a Filter array followed by first() does the same work in one action instead of one iteration per record.
How to debug one
Build the expression in a Compose action first. Compose does nothing except evaluate its input and show the result in the run history, so you can see what a subexpression returns before nesting it three levels deep. When a run fails, open the failed action and read its Inputsrather than the error text — the error tells you a property was not found, the inputs tell you what the shape actually was.
Frequently Asked Questions
Expressions are formulas (similar to Excel) used in Power Automate flows to manipulate data, format dates, convert arrays, and handle conditional logic. They are entered in the "Expression" tab of the dynamic content pane within any action input.
Click any input field in a flow action → the dynamic content pane appears → switch to the "Expression" tab → type or paste your formula → click "OK". The expression replaces the input field value.
Common causes: (1) referencing a property that doesn't exist — use coalesce() for a fallback, (2) incorrect trigger/action reference name — check the "Outputs" of previous steps, (3) case sensitivity in property names — JSON properties are case-sensitive.
Use formatDateTime(triggerBody()?['DateField'], 'yyyy-MM-dd'). Common format strings: yyyy-MM-dd (ISO), MM/dd/yyyy (US), dd-MMM-yyyy (e.g., "15-Jan-2026"). Always convert to UTC first with convertTimeZone() if working across time zones.
triggerBody() returns the output of the flow's trigger (e.g., a SharePoint item or HTTP request body). body('ActionName') returns the output of a specific action. Use outputs('ActionName')?['body'] for more explicit referencing.
Key array functions: length() for count, first()/last() for endpoints, contains() for searching, union() to merge, intersection() for common items, and join() to convert to a comma-separated string. Use Apply to Each for iteration.
Yes. Use the if(condition, trueValue, falseValue) function. For complex logic, nest them: if(equals(x,1), "A", if(equals(x,2), "B", "C")). For flow-level branching, use the Condition or Switch action instead.