⚙️

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.

🔍

Showing 61 expressions

concatString

Combines two or more strings into one.

Syntaxconcat('str1', 'str2', ...)
Exampleconcat('Hello', ' ', 'World') → 'Hello World'
substringString

Returns a portion of a string starting at the specified position.

Syntaxsubstring('text', startIndex, length)
Examplesubstring('Hello World', 6, 5) → 'World'
replaceString

Replaces all occurrences of a substring with a new value.

Syntaxreplace('text', 'old', 'new')
Examplereplace('Hello World', 'World', 'Power Automate') → 'Hello Power Automate'
toLowerString

Converts a string to all lowercase characters.

SyntaxtoLower('text')
ExampletoLower('HELLO') → 'hello'
toUpperString

Converts a string to all uppercase characters.

SyntaxtoUpper('text')
ExampletoUpper('hello') → 'HELLO'
trimString

Removes leading and trailing whitespace from a string.

Syntaxtrim('text')
Exampletrim(' hello ') → 'hello'
indexOfString

Returns the starting position of a substring. Returns -1 if not found.

SyntaxindexOf('text', 'search')
ExampleindexOf('Hello World', 'World') → 6
startsWithString

Checks whether a string starts with the specified substring.

SyntaxstartsWith('text', 'prefix')
ExamplestartsWith('Hello World', 'Hello') → true
endsWithString

Checks whether a string ends with the specified substring.

SyntaxendsWith('text', 'suffix')
ExampleendsWith('Hello World', 'World') → true
splitString

Splits a string into an array using the specified delimiter.

Syntaxsplit('text', 'delimiter')
Examplesplit('a,b,c', ',') → ['a','b','c']
lengthString

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

Syntaxlength('text')
Examplelength('Hello') → 5
guidString

Generates a globally unique identifier (GUID) string.

Syntaxguid()
Exampleguid() → 'c2ecc88d-88c8-4096-912c-d6f2e2b138ce'
utcNowDate / Time

Returns the current UTC timestamp. Optionally formatted.

SyntaxutcNow('format')
ExampleutcNow('yyyy-MM-dd') → '2026-03-08'
formatDateTimeDate / Time

Formats a date/time value using the specified format string.

SyntaxformatDateTime('timestamp', 'format')
ExampleformatDateTime('2026-03-08T10:00:00Z', 'dd/MM/yyyy') → '08/03/2026'
addDaysDate / Time

Adds the specified number of days to a timestamp.

SyntaxaddDays('timestamp', days, 'format')
ExampleaddDays('2026-03-08', 7) → '2026-03-15'
addHoursDate / Time

Adds the specified number of hours to a timestamp.

SyntaxaddHours('timestamp', hours, 'format')
ExampleaddHours('2026-03-08T10:00:00Z', 3) → '2026-03-08T13:00:00Z'
addMinutesDate / Time

Adds the specified number of minutes to a timestamp.

SyntaxaddMinutes('timestamp', minutes, 'format')
ExampleaddMinutes('2026-03-08T10:00:00Z', 30) → '2026-03-08T10:30:00Z'
convertTimeZoneDate / Time

Converts a timestamp from one time zone to another.

SyntaxconvertTimeZone('timestamp', 'sourceZone', 'destZone', 'format')
ExampleconvertTimeZone(utcNow(), 'UTC', 'Eastern Standard Time', 'yyyy-MM-dd HH:mm')
dayOfWeekDate / Time

Returns the day of the week (0 = Sunday, 6 = Saturday).

SyntaxdayOfWeek('timestamp')
ExampledayOfWeek('2026-03-08') → 0
dayOfMonthDate / Time

Returns the day of the month component.

SyntaxdayOfMonth('timestamp')
ExampledayOfMonth('2026-03-08') → 8
ticksDate / Time

Returns the ticks (100-nanosecond intervals since 01/01/0001).

Syntaxticks('timestamp')
Exampleticks('2026-03-08T00:00:00Z') → 638793...
firstCollection

Returns the first item from an array or first character of a string.

Syntaxfirst(collection)
Examplefirst(createArray(1,2,3)) → 1
lastCollection

Returns the last item from an array or last character of a string.

Syntaxlast(collection)
Examplelast(createArray(1,2,3)) → 3
containsCollection

Checks whether an array contains a value, or a string contains a substring.

Syntaxcontains(collection, value)
Examplecontains('Hello World', 'World') → true
emptyCollection

Checks whether a collection, string, or object is empty.

Syntaxempty(collection)
Exampleempty('') → true
joinCollection

Joins all items in an array into a single string with a delimiter.

Syntaxjoin(collection, 'delimiter')
Examplejoin(createArray('a','b','c'), ', ') → 'a, b, c'
createArrayCollection

Creates an array from the specified items.

SyntaxcreateArray(item1, item2, ...)
ExamplecreateArray(1, 2, 3) → [1, 2, 3]
unionCollection

Returns a collection that has all items from the specified collections (no duplicates).

Syntaxunion(collection1, collection2)
Exampleunion(createArray(1,2), createArray(2,3)) → [1,2,3]
intersectionCollection

Returns a collection that has only the common items across the specified collections.

Syntaxintersection(collection1, collection2)
Exampleintersection(createArray(1,2,3), createArray(2,3,4)) → [2,3]
ifLogical

Returns one of two values based on whether a condition is true or false.

Syntaxif(condition, valueIfTrue, valueIfFalse)
Exampleif(equals(1,1), 'yes', 'no') → 'yes'
equalsLogical

Checks whether both values are equal. Returns true or false.

Syntaxequals(value1, value2)
Exampleequals(1, 1) → true
andLogical

Returns true only if all expressions are true.

Syntaxand(expr1, expr2)
Exampleand(equals(1,1), equals(2,2)) → true
orLogical

Returns true if at least one expression is true.

Syntaxor(expr1, expr2)
Exampleor(equals(1,2), equals(2,2)) → true
notLogical

Returns the opposite boolean value.

Syntaxnot(expression)
Examplenot(true) → false
greaterLogical

Returns true if the first value is greater than the second.

Syntaxgreater(value1, value2)
Examplegreater(10, 5) → true
lessLogical

Returns true if the first value is less than the second.

Syntaxless(value1, value2)
Exampleless(5, 10) → true
coalesceLogical

Returns the first non-null value from the arguments.

Syntaxcoalesce(value1, value2, ...)
Examplecoalesce(null, '', 'fallback') → ''
intConversion

Converts a string to an integer.

Syntaxint('value')
Exampleint('42') → 42
floatConversion

Converts a string to a floating-point number.

Syntaxfloat('value')
Examplefloat('3.14') → 3.14
stringConversion

Converts a value to its string representation.

Syntaxstring(value)
Examplestring(42) → '42'
boolConversion

Converts a value to a boolean.

Syntaxbool('value')
Examplebool(1) → true
jsonConversion

Parses a JSON string into an object or array.

Syntaxjson('jsonString')
Examplejson('{"name":"Riz"}') → { name: "Riz" }
base64Conversion

Encodes a string to its Base64 representation.

Syntaxbase64('value')
Examplebase64('Hello') → 'SGVsbG8='
base64ToStringConversion

Decodes a Base64 string back to a plain string.

Syntaxbase64ToString('base64')
Examplebase64ToString('SGVsbG8=') → 'Hello'
uriComponentConversion

Encodes a string for safe use in a URL.

SyntaxuriComponent('value')
ExampleuriComponent('hello world') → 'hello%20world'
addMath

Returns the sum of two numbers.

Syntaxadd(num1, num2)
Exampleadd(10, 5) → 15
subMath

Returns the result of subtracting the second number from the first.

Syntaxsub(num1, num2)
Examplesub(10, 5) → 5
mulMath

Returns the product of two numbers.

Syntaxmul(num1, num2)
Examplemul(3, 4) → 12
divMath

Returns the integer result of dividing two numbers.

Syntaxdiv(num1, num2)
Examplediv(10, 3) → 3
modMath

Returns the remainder from dividing two numbers.

Syntaxmod(num1, num2)
Examplemod(10, 3) → 1
minMath

Returns the smallest value from a set of numbers or an array.

Syntaxmin(num1, num2, ...)
Examplemin(1, 5, 3) → 1
maxMath

Returns the largest value from a set of numbers or an array.

Syntaxmax(num1, num2, ...)
Examplemax(1, 5, 3) → 5
randMath

Returns a random integer between the specified min (inclusive) and max (exclusive).

Syntaxrand(minValue, maxValue)
Examplerand(1, 100) → 42
triggerBodyReferencing

Returns the trigger's body output at runtime.

SyntaxtriggerBody()
ExampletriggerBody()?['value'] → trigger payload
triggerOutputsReferencing

Returns the trigger's output at runtime.

SyntaxtriggerOutputs()
ExampletriggerOutputs()?['headers'] → trigger headers
bodyReferencing

Returns an action's body output at runtime.

Syntaxbody('actionName')
Examplebody('Get_items')?['value'] → items array
outputsReferencing

Returns an action's full output at runtime.

Syntaxoutputs('actionName')
Exampleoutputs('Send_email')?['statusCode'] → 200
itemsReferencing

Returns the current item in an Apply to each loop.

Syntaxitems('loopName')
Exampleitems('Apply_to_each')?['Title'] → current item title
variablesReferencing

Returns the value of a specified variable.

Syntaxvariables('varName')
Examplevariables('myCounter') → 5
parametersReferencing

Returns a workflow parameter value.

Syntaxparameters('paramName')
Exampleparameters('siteUrl') → 'https://contoso.sharepoint.com'
workflowReferencing

Returns details about the workflow itself at runtime.

Syntaxworkflow()
Exampleworkflow()?['run']?['name'] → run ID

What 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

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.