Power Automate Functions Explorer Beta v0.9 MS Learn Source ↗

Interactive Functions Reference Map Ctrl + scroll to zoomTap a function to view examples

Search Power Automate expression functions by name or task, browse categories, and open a function for examples and usage details.



100%


Power Automate expression function reference

Explore 137 Power Automate expression functions with examples. Search by function name or task, browse categories, and open a function to see how it works. This independent reference is useful for building and troubleshooting cloud flows.

How to use this reference

Search for a function such as trim or formatDateTime, or browse by category. Select a result to review its example and implementation details, then use the Microsoft Expressions Guide link for official documentation.

Browse functions by category

String functions

To work with strings, you can use these string functions and also some collection functions. String functions work only on strings.

  • chunk: Split a string or collection into chunks of equal length. Example: chunk('0123456789', 3) // Returns ['012', '345', '678', '9']
  • concat: Combine two or more strings, and return the combined string. Example: concat('Hello', ' ', 'World') // Returns 'Hello World'
  • endsWith: Check whether a string ends with the specified substring. Example: endsWith('Hello world', 'world') // Returns true
  • formatNumber: Return a number as a string based on the specified format Example: formatNumber(1234567890, '#,##0.00', 'en-US') // Returns '1,234,567,890.00' formatNumber(17.35, 'C2') // Returns '$17.35' formatNumber(17.35, 'C2', 'is-IS') // Returns '17,35 kr'
  • guid: Generate a globally unique identifier (GUID) as a string. Example: guid() // Returns e.g. 'c2ecc88d-88c8-4096-912c-d6f2e2b138ce' guid('P') // Returns e.g. '(c2ecc88d-88c8-4096-912c-d6f2e2b138ce)'
  • indexOf: Return the starting position for a substring. Example: indexOf('hello world', 'world') // Returns 6
  • isFloat: Return a boolean that indicates whether a string is a floating-point number. Example: isFloat('10.5') // Returns true isFloat('10.000,00', 'de-DE') // Returns true
  • isInt: Return a boolean that indicates whether a string is an integer. Example: isInt('10') // Returns true isInt('10.5') // Returns false
  • lastIndexOf: Return the starting position for the last occurrence of a substring. Example: lastIndexOf('hello world hello', 'hello') // Returns 12
  • length: Return the number of items in a string or array. Example: length('abcd') // Returns 4 length(createArray(0, 1, 2)) // Returns 3
  • nthIndexOf: Return the starting position or index value where the nth occurrence of a substring appears in a string. Example: nthIndexOf('123456789123456789', '1', 2) // Returns 9
  • replace: Replace a substring with the specified string, and return the updated string. Example: replace('the old string', 'old', 'new') // Returns 'the new string'
  • slice: Return a substring by specifying the starting and ending position or value. See also substring. Example: slice('Hello, World', 7, 12) // Returns 'World'
  • split: Return an array that contains substrings, separated by commas, from a larger string based on a specified delimiter character in the original string. Example: split('a,b,c', ',') // Returns ['a', 'b', 'c']
  • startsWith: Check whether a string starts with a specific substring. Example: startsWith('hello world', 'hello') // Returns true
  • substring: Return characters from a string, starting from the specified position. See also slice. Example: substring('hello world', 6, 5) // Returns 'world'
  • toLower: Return a string in lowercase format. Example: toLower('Hello World') // Returns 'hello world'
  • toUpper: Return a string in uppercase format. Example: toUpper('Hello World') // Returns 'HELLO WORLD'
  • trim: Remove leading and trailing whitespace from a string, and return the updated string. Example: trim(' hello ') // Returns 'hello'
  • trimByteOrderMark: Remove a byte order mark from the beginning of a string or binary content. Example: xml(trimByteOrderMark(concat(uriComponentToString('%EF%BB%BF'), '<produce><item>02</item></produce>'))) // Removes the UTF-8 BOM, then returns <produce><item>02</item></produce>

Collection functions

To work with collections, generally arrays, strings, and sometimes, dictionaries, you can use these collection functions.

  • contains: Check whether a collection has a specific item. Example: contains('hello world', 'world') // Returns true contains(createArray(1, 2, 3), 2) // Returns true
  • empty: Check whether a collection is empty. Example: empty('') // Returns true empty(createArray('a')) // Returns false
  • first: Return the first item from a collection. Example: first('hello') // Returns 'h' first(createArray(10, 20, 30)) // Returns 10
  • intersection: Return a collection that has only the common items across the specified collections. Example: intersection(createArray(1, 2, 3), createArray(2, 3, 4)) // Returns [2, 3]
  • item: If this function appears inside a repeating action over an array, return the current item in the array during the action's current iteration. Example: item()?['Title'] // Inside a loop, returns the Title of the current item
  • join: Return a string that has all the items from an array, separated by the specified character. Example: join(createArray('a', 'b', 'c'), '-') // Returns 'a-b-c'
  • last: Return the last item from a collection. Example: last('hello') // Returns 'o' last(createArray(10, 20, 30)) // Returns 30
  • reverse: Reverse the order of items in an array. Example: reverse(createArray(1, 2, 3)) // Returns [3, 2, 1]
  • skip: Remove items from the front of a collection, and return all the other items. Example: skip(createArray(0, 1, 2, 3), 1) // Returns [1, 2, 3]
  • sort: Sort items in a collection. Example: sort(createArray('c', 'a', 'b')) // Returns ['a', 'b', 'c'] sort(createArray(2, 1, 0, 3)) // Returns [0, 1, 2, 3] sort(createArray(json('{ "first": "Amalie", "last": "Rose" }'), json('{ "first": "Elise", "last": "Renee" }')), 'last') // Returns the Elise Renee object first, then the Amalie Rose object
  • take: Return items from the front of a collection. Example: take(createArray(0, 1, 2, 3), 2) // Returns [0, 1]
  • union: Return a collection that has all the items from the specified collections. Example: union(createArray(1, 2, 3), createArray(3, 4, 5)) // Returns [1, 2, 3, 4, 5]

Logical comparison functions

To work with conditions, compare values and expression results, or evaluate various kinds of logic, you can use these logical comparison functions.

  • and: Check whether all expressions are true. Example: and(equals(1, 1), equals(2, 2)) // Returns true
  • equals: Check whether both values are equivalent. Example: equals(10, 10) // Returns true equals(true, 1) // Returns true equals('abc', 'abcd') // Returns false
  • greater: Check whether the first value is greater than the second value. Example: greater(10, 5) // Returns true
  • greaterOrEquals: Check whether the first value is greater than or equal to the second value. Example: greaterOrEquals(5, 5) // Returns true
  • if: Check whether an expression is true or false. Based on the result, return a specified value. Example: if(equals(1, 1), 'yes', 'no') // Returns 'yes'
  • less: Check whether the first value is less than the second value. Example: less(5, 10) // Returns true
  • lessOrEquals: Check whether the first value is less than or equal to the second value. Example: lessOrEquals(5, 5) // Returns true
  • not: Check whether an expression is false. Example: not(equals(1, 2)) // Returns true
  • or: Check whether at least one expression is true. Example: or(equals(1, 2), equals(2, 2)) // Returns true
  • strongEquals: Check whether values of the same type are equivalen Example: strongEquals(1, 1.0) // Returns true

Conversion functions

To change a value's type or format, you can use these conversion functions.

  • array: Return an array from a single specified input. For multiple inputs, see createArray. Example: array('hello') // Returns ['hello']
  • base64: Return the base64-encoded version for a string. Example: base64('hello') // Returns 'aGVsbG8='
  • base64ToBinary: Return the binary version for a base64-encoded string. Example: base64ToBinary('aGVsbG8=') // Returns the binary for 'hello'
  • base64ToJson: Return the JSON value for a base64-encoded string. Example: base64ToJson('eyJuYW1lIjoiQW5uIn0=') // Returns {"name": "Ann"}
  • base64ToString: Return the string version for a base64-encoded string. Example: base64ToString('aGVsbG8=') // Returns 'hello'
  • binary: Return the binary version for an input value. Example: binary('hello') // Returns the binary version of 'hello'
  • bool: Return the Boolean version for an input value. Example: bool(1) // Returns true bool('false') // Returns false
  • createArray: Return an array from multiple inputs. Example: createArray('a', 'b', 'c') // Returns ['a', 'b', 'c']
  • dataUri: Return the data URI for an input value. Example: dataUri('hello') // Returns 'data:text/plain;charset=utf-8;base64,aGVsbG8='
  • dataUriToBinary: Return the binary version for a data URI. Example: dataUriToBinary('data:text/plain;charset=utf-8;base64,aGVsbG8=') // Returns the binary for 'hello'
  • dataUriToString: Return the string version for a data URI. Example: dataUriToString('data:text/plain;charset=utf-8;base64,aGVsbG8=') // Returns 'hello'
  • decimal: Return the decimal number for a decimal string. Example: decimal('1.2345678912312131') // Returns 1.234567891231213 string(decimal('1.2345678912312131')) // Returns '1.2345678912312131'
  • decodeBase64: Return the string version for a base64-encoded string. Example: decodeBase64('aGVsbG8=') // Returns 'hello'
  • decodeDataUri: Return the binary version for a data URI. Example: decodeDataUri('data:text/plain;charset=utf-8;base64,aGVsbG8=') // Returns the binary for 'hello'
  • decodeUriComponent: Return a string that replaces escape characters with decoded versions. Example: decodeUriComponent('https%3A%2F%2Fcontoso.com') // Returns 'https://contoso.com'
  • encodeBase64: Return the base64-encoded version for a string. Example: encodeBase64('hello') // Returns 'aGVsbG8='
  • encodeUriComponent: Return a string that replaces URL-unsafe characters with escape characters. Example: encodeUriComponent('https://contoso.com') // Returns 'https%3A%2F%2Fcontoso.com'
  • float: Return a floating point number for an input value. Example: float('10.333') // Returns 10.333
  • int: Return the integer version for a string. Example: int('10') // Returns 10
  • json: Return the JavaScript Object Notation (JSON) type value or object for a string or XML. Example: json('{"fullName": "Sophia Owen"}') // Returns {"fullName": "Sophia Owen"} json(xml('<?xml version="1.0"?><root><a>1</a></root>'))
  • parse (deprecated): Return the JSON value or object for a string or XML. Example: // Deprecated - use json() or the Parse JSON action instead
  • string: Return the string version for an input value. Example: string(10) // Returns '10' string({ "name": "Sophie Owen" }) // Returns '{ \"name\": \"Sophie Owen\" }' (the quotation marks are escaped)
  • uriComponent: Return the URI-encoded version for an input value by replacing URL-unsafe characters with escape characters. Example: uriComponent('https://contoso.com') // Returns 'https%3A%2F%2Fcontoso.com'
  • uriComponentToBinary: Return the binary version for a URI-encoded string. Example: uriComponentToBinary('https%3A%2F%2Fcontoso.com') // Returns the binary for the decoded string
  • uriComponentToString: Return the string version for a URI-encoded string. Example: uriComponentToString('https%3A%2F%2Fcontoso.com') // Returns 'https://contoso.com'
  • xml: Return the XML version for a string. Example: xml(json('{"name": "Sophia"}')) // Returns '<name>Sophia</name>'

Math functions

To work with integers and floats, you can use these math functions.

  • add: Return the result from adding two numbers. Example: add(1, 1.5) // Returns 2.5
  • div: Return the result from dividing two numbers. Example: div(10, 5) // Returns 2
  • max: Return the highest value from a set of numbers or an array. Example: max(1, 3, 2) // Returns 3 max(createArray(1, 3, 2)) // Returns 3
  • min: Return the lowest value from a set of numbers or an array. Example: min(1, 3, 2) // Returns 1
  • mod: Return the remainder from dividing two numbers. Example: mod(7, 3) // Returns 1
  • mul: Return the product from multiplying two numbers. Example: mul(3, 4) // Returns 12
  • pow: Return a number raised to a specified power. Example: pow(2, 10) // Returns 1024.0
  • rand: Return a random integer from a specified range. Example: rand(1, 5) // Returns 1, 2, 3 or 4
  • range: Return an integer array that starts from a specified integer. Example: range(1, 4) // Returns [1, 2, 3, 4]
  • sub: Return the result from subtracting the second number from the first number. Example: sub(10, 3) // Returns 7

Date and time functions

To work with dates and times, you can use these date and time functions.

  • addDays: Add days to a timestamp. Example: addDays('2025-03-15T00:00:00Z', 5) // Returns '2025-03-20T00:00:00.0000000Z'
  • addHours: Add hours to a timestamp. Example: addHours('2025-03-15T00:00:00Z', 5) // Returns '2025-03-15T05:00:00.0000000Z'
  • addMinutes: Add minutes to a timestamp. Example: addMinutes('2025-03-15T00:00:00Z', 30) // Returns '2025-03-15T00:30:00.0000000Z'
  • addSeconds: Add seconds to a timestamp. Example: addSeconds('2025-03-15T00:00:00Z', 10) // Returns '2025-03-15T00:00:10.0000000Z'
  • addToTime: Add specified time units to a timestamp. See also getFutureTime. Example: addToTime('2025-03-15T00:00:00Z', 2, 'Week') // Returns '2025-03-29T00:00:00.0000000Z'
  • convertFromUtc: Convert a timestamp from Universal Time Coordinated (UTC) to the target time zone. Example: convertFromUtc('2025-03-15T12:00:00Z', 'Pacific Standard Time') // Returns '2025-03-15T05:00:00.0000000'
  • convertTimeZone: Convert a timestamp from the source time zone to the target time zone. Example: convertTimeZone('2025-03-15T12:00:00Z', 'UTC', 'GMT Standard Time') // Returns '2025-03-15T12:00:00.0000000'
  • convertToUtc: Convert a timestamp from the source time zone to Universal Time Coordinated (UTC). Example: convertToUtc('2025-03-15T05:00:00', 'Pacific Standard Time') // Returns '2025-03-15T12:00:00.0000000Z'
  • dateDifference: Return the difference between two dates as a timespan. Example: dateDifference('2025-03-15', '2025-03-20') // Returns '5.00:00:00'
  • dayOfMonth: Return the day of the month component from a timestamp. Example: dayOfMonth('2025-03-15T13:27:36Z') // Returns 15
  • dayOfWeek: Return the day of the week component from a timestamp. Example: dayOfWeek('2025-03-15T13:27:36Z') // Returns 6
  • dayOfYear: Return the day of the year component from a timestamp. Example: dayOfYear('2025-03-15T13:27:36Z') // Returns 74
  • formatDateTime: Return the date from a timestamp. Example: formatDateTime('2025-03-15T13:27:36Z', 'dd/MM/yyyy') // Returns '15/03/2025'
  • formatTimeSpan: Return a time span in the specified format. Example: formatTimeSpan('4.20:00:00', '%d') // Returns '4' formatTimeSpan('1:00:00.11', 'g', 'de-DE') // Returns '1:00:00,11'
  • getFutureTime: Return the current timestamp plus the specified time units. See also addToTime. Example: getFutureTime(5, 'Day') // Returns the timestamp 5 days from now
  • getPastTime: Return the current timestamp minus the specified time units. See also subtractFromTime. Example: getPastTime(5, 'Day') // Returns the timestamp 5 days ago
  • parseDateTime: Return the timestamp from a string that contains a timestamp. Example: parseDateTime('20/10/2014', 'fr-fr') // Returns '2014-10-20T00:00:00.0000000' parseDateTime('21052019', 'fr-fr', 'ddMMyyyy') // Returns '2019-05-21T00:00:00.0000000'
  • startOfDay: Return the start of the day for a timestamp. Example: startOfDay('2025-03-15T13:27:36Z') // Returns '2025-03-15T00:00:00.0000000Z'
  • startOfHour: Return the start of the hour for a timestamp. Example: startOfHour('2025-03-15T13:27:36Z') // Returns '2025-03-15T13:00:00.0000000Z'
  • startOfMonth: Return the start of the month for a timestamp. Example: startOfMonth('2025-03-15T13:27:36Z') // Returns '2025-03-01T00:00:00.0000000Z'
  • subtractFromTime: Subtract a number of time units from a timestamp. See also getPastTime. Example: subtractFromTime('2025-03-15T00:00:00Z', 1, 'Week') // Returns '2025-03-08T00:00:00.0000000Z'
  • ticks: Return the ticks property value for a specified timestamp. Example: ticks('2025-03-15T00:00:00Z') // Returns 638775936000000000
  • utcNow: Return the current timestamp as a string. Example: utcNow() // Returns e.g. '2025-03-15T13:27:36.0000000Z' utcNow('yyyy-MM-dd') // Returns e.g. '2025-03-15'

Workflow functions

Access workflow runtime details, inputs, triggers, and action outputs.

  • action: Return the current action's output at runtime, or values from other JSON name-and-value pairs. See also actions. Example: action()['outputs'] // Returns the current action's outputs
  • actions: Return an action's output at runtime, or values from other JSON name-and-value pairs. See also action. Example: actions('Get_items')['outputs']['body'] // Returns the output body of the action 'Get_items'
  • body: Return an action's body output at runtime. Example: body('Get_items')?['value'] // Returns the value array from the action's body
  • formDataMultiValues: Create an array with the values that match a key name in form-data or form-encoded action outputs. Example: formDataMultiValues('Send_form', 'tag') // Returns an array of all 'tag' values
  • formDataValue: Return a single value that matches a key name in an action's form-data or form-encoded output. Example: formDataValue('Send_form', 'name') // Returns the value of 'name'
  • items: If this function appears inside a Foreach or Until loop, return the current item from the specified loop. Example: items('Apply_to_each')?['Title'] // Returns the current item's Title
  • iterationIndexes: If this function appears inside an Until loop, return the index value for the current iteration. You can use this function inside nested Until loops. Example: iterationIndexes('Do_until') // Returns the current loop iteration index
  • listCallbackUrl: Return the "callback URL" that calls a trigger or action. Example: listCallbackUrl() // Returns the callback URL of the trigger or webhook action
  • multipartBody: Return the body for a specific part in an action's output that has multiple parts. Example: multipartBody('Http', 0) // Returns the body of the first part
  • outputs: Return an action's output at runtime. Example: outputs('Compose') // Returns the output of the action 'Compose'
  • parameters: Return the value for a parameter that is described in your workflow definition. Example: parameters('siteUrl') // Returns the value of the flow parameter 'siteUrl'
  • result: Return the inputs and outputs from the top-level actions inside the specified scoped action, such as For_each, Until, and Scope. Example: result('Scope') // Returns inputs and outputs of each action in the Scope
  • trigger: Return a trigger's output at runtime, or from other JSON name-and-value pairs. See also triggerOutputs and triggerBody. Example: trigger()['outputs'] // Returns the trigger's outputs
  • triggerBody: Return a trigger's body output at runtime. See trigger. Example: triggerBody()?['email'] // Returns the 'email' property of the trigger body
  • triggerFormDataValue: Return a single value matching a key name in form-data or form-encoded trigger outputs. Example: triggerFormDataValue('name') // Returns the value of 'name' in the trigger form data
  • triggerMultipartBody: Return the body for a specific part in a trigger's multipart output. Example: triggerMultipartBody(0) // Returns the body of the trigger's first part
  • triggerFormDataMultiValues: Create an array whose values match a key name in form-data or form-encoded trigger outputs. Example: triggerFormDataMultiValues('tag') // Returns an array of all 'tag' values
  • triggerOutputs: Return a trigger's output at runtime, or values from other JSON name-and-value pairs. See trigger. Example: triggerOutputs()?['headers'] // Returns the trigger's headers
  • variables: Return the value for a specified variable. Example: variables('counter') // Returns the current value of the variable 'counter'
  • workflow: Return all the details about the workflow itself during run time. Example: workflow()['run']['name'] // Returns the current run ID

URI parsing functions

To work with uniform resource identifiers (URIs) and get various property values for these URIs, you can use these URI parsing functions.

  • uriHost: Return the host value for a uniform resource identifier (URI). Example: uriHost('https://www.contoso.com/path?x=1') // Returns 'www.contoso.com'
  • uriPath: Return the path value for a uniform resource identifier (URI). Example: uriPath('https://www.contoso.com/path?x=1') // Returns '/path'
  • uriPathAndQuery: Return the path and query values for a uniform resource identifier (URI). Example: uriPathAndQuery('https://www.contoso.com/path?x=1') // Returns '/path?x=1'
  • uriPort: Return the port value for a uniform resource identifier (URI). Example: uriPort('https://www.contoso.com:8080/path') // Returns 8080
  • uriQuery: Return the query value for a uniform resource identifier (URI). Example: uriQuery('https://www.contoso.com/path?x=1') // Returns '?x=1'
  • uriScheme: Return the scheme value for a uniform resource identifier (URI) Example: uriScheme('https://www.contoso.com/path') // Returns 'https'

Manipulation functions: JSON & XML

To work with JSON objects and XML nodes, you can use these manipulation functions.

  • addProperty: Add a property and its value, or name-value pair, to a JSON object, and return the updated object. Example: addProperty(json('{"a": 1}'), 'b', 2) // Returns {"a": 1, "b": 2}
  • coalesce: Return the first non-null value from one or more parameters. Example: coalesce(null, null, 'fallback') // Returns 'fallback'
  • decodeXmlName: Decode an XML element name. Example: decodeXmlName('data_x002F_value') // Returns 'data/value'
  • decodeXmlValue: Decode an XML element value. Example: decodeXmlValue('&lt;value&gt;') // Returns '<value>'
  • encodeXmlName: Encode a string as an XML element name. Example: encodeXmlName('data/value') // Returns 'data_x002F_value'
  • encodeXmlValue: Encode a string as an XML element value. Example: encodeXmlValue('<value>') // Returns '&lt;value&gt;'
  • mergeObjects: Merge two JSON objects. Example: mergeObjects(json('{"a": 1}'), json('{"b": 2}')) // Returns {"a": 1, "b": 2}
  • removeProperty: Remove a property from a JSON object and return the updated object. Example: removeProperty(json('{"a": 1, "b": 2}'), 'b') // Returns {"a": 1}
  • setProperty: Set the value for a JSON object's property and return the updated object. Example: setProperty(json('{"a": 1}'), 'a', 5) // Returns {"a": 5}
  • xpath: Check XML for nodes or values that match an XPath (XML Path Language) expression, and return the matching nodes or values. Example: xpath(xml(parameters('items')), '/produce/item/name/text()') // Returns ['Gala', 'Honeycrisp'] for the items XML in the reference xpath(xml(parameters('items')), 'sum(/produce/item/count)') // Returns 30

Frequently asked questions

What are Power Automate expression functions?

Expression functions are built-in formulas used in Power Automate and Azure Logic Apps to transform text, work with dates and numbers, handle collections, and evaluate conditions. Examples include concat(), formatDateTime(), and if().

How do I use an expression function in a Power Automate flow?

In an action field, open the Expression tab, enter the function with its arguments, and select Add. Use this explorer to find a function and review its example before adding it to your flow.

How do I format a date in Power Automate?

Use formatDateTime() with a timestamp and a format string. For example, formatDateTime(utcNow(), 'yyyy-MM-dd') returns the current UTC date in year-month-day format. Apply any required time-zone conversion before formatting.

How do I remove whitespace from text in Power Automate?

Use trim() to remove whitespace from the beginning and end of a string, for example trim(' hello ') returns 'hello'.

Where can I find examples for Power Automate functions?

Search or browse this reference, then select a function to see its purpose, an expression example, and implementation details. Use the Microsoft Expressions Guide link for the official documentation.

Explore more free Power Automate tools