Every Power Automate expression is built from functions. Need to cut a name out of an email subject, add 30 days to a due date, or check whether a SharePoint column is empty? There is a function for it, and once you know the handful you’ll use every week, most flow problems get much smaller.
This page lists all 136 functions of the expression language that Power Automate cloud flows use, grouped the same way Microsoft groups them. Click a function name to open its full tutorial with the syntax, real examples tested in a flow, and the mistakes to avoid. New function tutorials are added every day.
Tip: New to expressions? Start with the Power Automate tutorials hub, then come back here whenever you need a specific function.
Jump to a category
- String functions (20)
- Collection (array) functions (12)
- Logical comparison functions (10)
- Conversion functions (25)
- Math functions (10)
- Date and time functions (23)
- Workflow functions (20)
- JSON and XML functions (10)
- URI parsing functions (6)
How to use a function in Power Automate
You type functions in the expression editor, not as plain text. In the new designer, click inside any action field, select the fx icon (or type a forward slash and choose Insert expression), type the expression, and select Add. Don’t type the leading @ sign; Power Automate adds it for you.
Functions can be nested, so the output of one becomes the input of another. This expression takes a SharePoint title, trims the spaces, and converts it to uppercase:
toUpper(trim(triggerBody()?['Title']))
Text values go in single quotes, numbers don’t, and positions in strings and arrays start at 0.
String functions
String functions work on text: join it, cut it, search it, change its case, or check what it contains. You’ll use them most with SharePoint text columns, email subjects, and file names. For a quick tour with examples, see Power Automate String Functions.
| Function | What it does |
|---|---|
| split() | Splits a string into an array at every delimiter you choose. |
| concat() | Joins two or more strings into one string. |
| replace() | Replaces every match of a text inside a string with new text (case-sensitive). |
| substring() | Returns characters from a string, starting at a position, for a given length. |
| length() | Returns the number of characters in a string or items in an array. |
| indexOf() | Returns the start position of a text inside a string (-1 if not found, not case-sensitive). |
| trim() | Removes leading and trailing whitespace from a string. |
| toLower() | Converts a string to lowercase. |
| toUpper() | Converts a string to uppercase. |
| slice() | Returns part of a string between a start and an end position (negative positions count from the end). |
| startsWith() | Checks whether a string starts with a specific text (not case-sensitive). |
| endsWith() | Checks whether a string ends with a specific text (not case-sensitive). |
| guid() | Generates a globally unique identifier (GUID) string. |
| formatNumber() | Formats a number as a string, for example currency or thousand separators. |
| lastIndexOf() | Returns the start position of the last match of a text inside a string. |
| nthIndexOf() | Returns the start position of the nth match of a text inside a string. |
| chunk() | Splits a string or array into chunks of equal length. |
| isInt() | Checks whether a string is a whole number. |
| isFloat() | Checks whether a string is a floating-point number. |
| trimByteOrderMark() | Removes the byte order mark (BOM) characters from the start of a string or file content. |
Collection (array) functions
Collection functions work on arrays and strings as lists: pick the first or last item, combine lists, remove duplicates, or check if a value is in the list.
| Function | What it does |
|---|---|
| empty() | Checks whether a string, array, or object is empty. |
| join() | Joins every item of an array into one string with a delimiter. |
| contains() | Checks whether a string, array, or object contains a value. |
| first() | Returns the first item of a string or array. |
| last() | Returns the last item of a string or array. |
| item() | Returns the current item inside a loop (Apply to each) iteration. |
| union() | Returns one array or object with all items from the collections, without duplicates. |
| intersection() | Returns the items that exist in all the arrays or objects you pass. |
| take() | Returns items from the front of an array or string. |
| skip() | Removes items from the front of an array and returns the rest. |
| reverse() | Reverses the order of the items in an array. |
| sort() | Sorts the items in an array, optionally by a property. |
Logical comparison functions
Logical functions compare values and return true or false. They power conditions, trigger conditions, and if() expressions.
| Function | What it does |
|---|---|
| if() | Returns one of two values depending on whether a condition is true or false. |
| equals() | Checks whether two values are equal. |
| and() | Returns true only when every condition is true. |
| or() | Returns true when at least one condition is true. |
| not() | Reverses a Boolean value (true becomes false). |
| greater() | Checks whether the first value is greater than the second. |
| less() | Checks whether the first value is less than the second. |
| greaterOrEquals() | Checks whether the first value is greater than or equal to the second. |
| lessOrEquals() | Checks whether the first value is less than or equal to the second. |
| strongEquals() | Checks whether two values are equal and of the same type. |
Conversion functions
Conversion functions change a value from one type to another: text to number, string to JSON, text to base64, and back.
| Function | What it does |
|---|---|
| int() | Converts a string to an integer. |
| createArray() | Builds an array from the values you pass. |
| json() | Converts a string or XML to a JSON object or array. |
| string() | Converts a value to a string. |
| float() | Converts a string to a floating-point number. |
| decimal() | Converts a string to a decimal number with full precision. |
| bool() | Converts a value to a Boolean (true or false). |
| array() | Returns an array from a single value. |
| xml() | Converts a JSON string or object to XML. |
| base64() | Encodes a string as base64. |
| base64ToString() | Decodes a base64 string back to plain text. |
| base64ToBinary() | Converts a base64 string to binary content. |
| binary() | Converts a string to binary content. |
| dataUri() | Converts a string to a data URI. |
| dataUriToBinary() | Converts a data URI to binary content. |
| dataUriToString() | Converts a data URI back to a string. |
| decodeBase64() | Decodes a base64 string (older name; use base64ToString). |
| encodeBase64() | Encodes a string as base64 (older name; use base64). |
| decodeDataUri() | Decodes a data URI to binary content. |
| uriComponent() | URL-encodes a string by replacing unsafe characters with escape codes. |
| uriComponentToString() | Decodes a URL-encoded string back to plain text. |
| uriComponentToBinary() | Converts a URL-encoded string to binary content. |
| encodeUriComponent() | URL-encodes a string (older name; use uriComponent). |
| decodeUriComponent() | Decodes a URL-encoded string (older name; use uriComponentToString). |
| parse() | Parses a string into a value (check Power Automate support). |
Math functions
Math functions do arithmetic on integers and decimals, from add() and sub() to random numbers and ranges.
| Function | What it does |
|---|---|
| add() | Adds two numbers. |
| sub() | Subtracts the second number from the first. |
| mul() | Multiplies two numbers. |
| div() | Divides the first number by the second (integer result for whole numbers). |
| mod() | Returns the remainder after dividing two numbers. |
| max() | Returns the highest value from numbers or an array. |
| min() | Returns the lowest value from numbers or an array. |
| range() | Returns an array of whole numbers that starts at a number, for a count. |
| rand() | Returns a random whole number in a range. |
| pow() | Raises a number to the power of another number. |
Date and time functions
Date and time functions return the current time, add or subtract time, convert time zones, and format dates for emails and SharePoint columns. Every timestamp is UTC unless you convert it. For a quick tour with examples, see Power Automate Date Functions.
| Function | What it does |
|---|---|
| formatDateTime() | Formats a date and time with a format string. |
| utcNow() | Returns the current date and time in UTC. |
| addDays() | Adds days to a timestamp. |
| convertTimeZone() | Converts a timestamp from one time zone to another. |
| dateDifference() | Returns the difference between two dates as a time span. |
| ticks() | Returns the number of 100-nanosecond ticks since January 1, 0001 for a timestamp. |
| addHours() | Adds hours to a timestamp. |
| addMinutes() | Adds minutes to a timestamp. |
| startOfDay() | Returns the start of the day for a timestamp. |
| startOfMonth() | Returns the start of the month for a timestamp. |
| dayOfWeek() | Returns the day of the week from a timestamp (0 = Sunday). |
| addToTime() | Adds a number of time units to a timestamp. |
| subtractFromTime() | Subtracts a number of time units from a timestamp. |
| getFutureTime() | Returns the current time plus a number of time units. |
| getPastTime() | Returns the current time minus a number of time units. |
| dayOfMonth() | Returns the day of the month from a timestamp. |
| dayOfYear() | Returns the day of the year from a timestamp. |
| convertFromUtc() | Converts a UTC timestamp to a target time zone. |
| convertToUtc() | Converts a timestamp from a time zone to UTC. |
| parseDateTime() | Converts a date string in a known format or locale to a timestamp. |
| addSeconds() | Adds seconds to a timestamp. |
| formatTimeSpan() | Formats a time span as a string. |
| startOfHour() | Returns the start of the hour for a timestamp. |
Workflow functions
Workflow functions read data from the flow itself: the trigger, other actions’ outputs, loop items, variables, and details about the current run.
| Function | What it does |
|---|---|
| items() | Returns the current item of a named Apply to each loop. |
| variables() | Returns the value of a variable. |
| triggerBody() | Returns the body output of the flow’s trigger. |
| body() | Returns the body output of an action. |
| outputs() | Returns the full output of an action. |
| triggerOutputs() | Returns the full output (headers and body) of the flow’s trigger. |
| trigger() | Returns the trigger’s output while the trigger runs (used in trigger conditions). |
| actions() | Returns an action’s output at runtime, including status and inputs. |
| action() | Returns the current action’s output at runtime (used in expressions inside an action). |
| iterationIndexes() | Returns the current iteration number inside a Do until loop. |
| parameters() | Returns the value of a flow (solution) parameter or environment variable. |
| result() | Returns the results of all actions inside a scope (used for error handling). |
| workflow() | Returns details about the flow run itself, such as its name and run ID. |
| listCallbackUrl() | Returns the callback URL of an HTTP trigger or webhook action. |
| formDataValue() | Returns a single value from form-data or form-encoded action output. |
| formDataMultiValues() | Returns an array of values from form-data or form-encoded action output. |
| multipartBody() | Returns the body of one part of a multipart action output. |
| triggerFormDataValue() | Returns a single value from form-data or form-encoded trigger output. |
| triggerFormDataMultiValues() | Returns an array of values from form-data or form-encoded trigger output. |
| triggerMultipartBody() | Returns the body of one part of a multipart trigger output. |
JSON and XML functions
These functions edit JSON objects (add, set, or remove properties), pick the first non-null value, and query XML with XPath.
| Function | What it does |
|---|---|
| coalesce() | Returns the first value that isn’t null from a list of values. |
| setProperty() | Sets the value of a property in a JSON object (adds it if missing). |
| addProperty() | Adds a property and its value to a JSON object. |
| removeProperty() | Removes a property from a JSON object. |
| xpath() | Returns nodes or values from XML that match an XPath expression. |
| mergeObjects() | Merges two or more JSON objects into one object. |
| decodeXmlName() | Decodes an encoded XML element name back to its original text. |
| decodeXmlValue() | Decodes an encoded XML value back to its original text. |
| encodeXmlName() | Encodes text so it is a valid XML element name. |
| encodeXmlValue() | Encodes text so it is a valid XML value. |
URI parsing functions
URI parsing functions pull one part out of a web address, such as the host name, path, or query string.
| Function | What it does |
|---|---|
| uriHost() | Returns the host name from a URL. |
| uriPath() | Returns the path from a URL. |
| uriPathAndQuery() | Returns the path and query from a URL. |
| uriPort() | Returns the port number from a URL. |
| uriQuery() | Returns the query string from a URL. |
| uriScheme() | Returns the scheme (http or https) from a URL. |
Frequently Asked Questions
What is the difference between a function and an expression in Power Automate?
A function is one named operation, such as concat() or addDays(). An expression is the whole formula you type in the expression editor, and it can combine several functions, for example formatDateTime(addDays(utcNow(), 7), 'MM/dd/yyyy').
Do Power Automate functions compare text case-sensitively?
It depends on the function. Microsoft documents replace() as case-sensitive, while indexOf(), lastIndexOf(), and startsWith() ignore case. Each function tutorial says which way it works, tested in a real flow.
Can I use Excel or Power Apps formulas in Power Automate?
No. Cloud flows use the Workflow Definition Language from Azure Logic Apps, so the names and syntax differ. For example, Excel’s LEFT() is substring() or take() in Power Automate, and text values always go in single quotes.