Reference · Workflow expressions · Cloud flows
Power Automate Expression Reference
All the expression functions you can use in Power Automate cloud flows, with syntax, examples and the gotchas that break flows. Search by name or by task.
Works with
Power Automate
A
B
C
D
E
F
G
I
J
L
M
N
O
P
R
S
T
U
V
W
X
Guide
How to use this reference
Search or browse
Type a name or a task. Narrow it down with the A–Z strip or a category.
Open a card
See the syntax, what each part means, real examples and the gotchas makers run into.
Copy it in
Copy the syntax or an example, paste it into the Expression tab in your flow, and rename the actions.
Index
Every expression, A–Z
Each one also has its own page that you can bookmark or share.
A
- action · Returns the current action’s own result at runtime. Usable only in a few places, such as tracked properties.
- actions · Returns an action’s object at runtime, including its status, inputs and outputs.
- add · Adds two numbers.
- addDays · Adds days to a timestamp. Use a negative number to subtract.
- addHours · Adds hours to a timestamp. Use a negative number to subtract.
- addMinutes · Adds minutes to a timestamp. Use a negative number to subtract.
- addProperty · Adds a property to an object and returns the updated object.
- addSeconds · Adds seconds to a timestamp. Use a negative number to subtract.
- addToTime · Adds any number of time units (seconds to years) to a timestamp.
- and · Returns true only when every expression is true.
- array · Wraps a single value in an array.
B
- base64 · Encodes a string as base64.
- base64ToBinary · Decodes a base64 string into binary content, such as a file.
- base64ToJson · Decodes a base64 string and parses the result as JSON.
- base64ToString · Decodes a base64 string back to text.
- binary · Converts a string to binary content.
- body · Returns the body of an action’s output. Shorthand for actions(...).outputs.body.
- bool · Converts a value to true or false.
C
- chunk · Splits a string or an array into pieces of a set length.
- coalesce · Returns the first value that is not null.
- concat · Joins two or more strings into one.
- contains · Checks whether a string contains text, an array contains a value, or an object has a key.
- convertFromUtc · Converts a UTC timestamp to a target time zone.
- convertTimeZone · Converts a timestamp from one time zone to another.
- convertToUtc · Converts a timestamp from a source time zone to UTC.
- createArray · Creates an array from the values you list.
D
- dataUri · Converts a string to a data URI.
- dataUriToBinary · Converts a data URI to binary content.
- dataUriToString · Converts a data URI back to text.
- dateDifference · Returns the time between two dates as a timespan string ("days.hours:minutes:seconds").
- dayOfMonth · Returns the day of the month, from 1 to 31.
- dayOfWeek · Returns the day of the week as a number, where Sunday is 0.
- dayOfYear · Returns the day of the year, from 1 to 366.
- decimal · Converts a string to a high-precision decimal number.
- decodeBase64 · Decodes a base64 string to text. Deprecated: use base64ToString() instead.
- decodeDataUri · Returns the binary content of a data URI.
- decodeUriComponent · Turns URL-encoded escape characters back into normal text.
- decodeXmlName · Turns an encoded XML name back into normal text.
- decodeXmlValue · Turns escaped XML characters back into normal text.
- div · Divides one number by another.
E
- empty · Checks whether a string, array or object has nothing in it.
- encodeBase64 · Encodes a string as base64.
- encodeUriComponent · URL-encodes special characters so text is safe to put in a URL.
- encodeXmlName · Encodes text so it is a valid XML element or attribute name.
- encodeXmlValue · Escapes characters such as & and < so text is safe inside XML.
- endsWith · Checks whether a string ends with a substring. Not case-sensitive.
- equals · Checks whether two values are equivalent.
F
- first · Returns the first item of an array or the first character of a string.
- float · Converts a string to a decimal number, optionally for a specific locale.
- formatDateTime · Formats a timestamp as text in the pattern you choose.
- formatNumber · Formats a number as text, such as currency or with thousands separators.
- formatTimeSpan · Formats a timespan, such as the result of dateDifference(), as text.
- formDataMultiValues · Returns every value for a key in an action’s form-data or form-encoded output.
- formDataValue · Returns one value for a key in an action’s form-data or form-encoded output.
G
- getFutureTime · Returns the current UTC time plus a number of time units.
- getPastTime · Returns the current UTC time minus a number of time units.
- greater · Checks whether the first value is greater than the second.
- greaterOrEquals · Checks whether the first value is greater than or equal to the second.
- guid · Generates a new globally unique identifier (GUID) as a string.
I
- if · Returns one value when a condition is true and another when it is false.
- indexOf · Returns the zero-based position of a substring, or -1 if it isn’t found. Not case-sensitive.
- int · Converts a string to a whole number.
- intersection · Returns only the items that appear in every collection given.
- isFloat · Checks whether a string is a decimal number, optionally for a specific locale.
- isInt · Checks whether a string is a whole number.
- item · Returns the current item in an Apply to each loop, Select or Filter array.
- items · Returns the current item of a named Apply to each loop.
- iterationIndexes · Returns the index of the current iteration in a Do until loop.
J
L
- last · Returns the last item of an array or the last character of a string.
- lastIndexOf · Returns the position of the last occurrence of a substring, or -1. Not case-sensitive.
- length · Returns the number of characters in a string or the number of items in an array.
- less · Checks whether the first value is less than the second.
- lessOrEquals · Checks whether the first value is less than or equal to the second.
- listCallbackUrl · Returns the callback URL for the current trigger or action, used with HTTP webhooks.
M
- max · Returns the largest number from a list or an array.
- mergeObjects · Combines the properties of two objects into one.
- min · Returns the smallest number from a list or an array.
- mod · Returns the remainder after dividing one number by another.
- mul · Multiplies two numbers.
- multipartBody · Returns one part of an action’s multipart output.
N
- not · Flips a Boolean: true becomes false and false becomes true.
- nthIndexOf · Returns the position of the nth occurrence of a substring, or -1 if there are fewer.
O
P
- parameters · Returns the value of a workflow parameter, such as an environment variable in a solution.
- parseDateTime · Reads a date written as text, in a given locale or format, into a timestamp.
- pow · Raises a number to a power.
R
- rand · Returns a random whole number from a range. The maximum itself is never returned.
- range · Creates an array of consecutive whole numbers.
- removeProperty · Removes a property from an object and returns the updated object.
- replace · Replaces every occurrence of a substring with new text.
- result · Returns the results of the top-level actions inside a Scope, Apply to each or Do until.
- reverse · Returns an array in reverse order.
S
- setProperty · Sets the value of an object’s property and returns the updated object.
- skip · Removes a number of items from the front of an array and returns the rest.
- slice · Returns part of a string between two positions. Negative positions count from the end.
- sort · Sorts an array, optionally by a property of its objects.
- split · Splits a string into an array using a delimiter.
- startOfDay · Returns midnight at the start of the timestamp’s day.
- startOfHour · Returns the start of the timestamp’s hour.
- startOfMonth · Returns the first day of the timestamp’s month, at midnight.
- startsWith · Checks whether a string starts with a substring. Not case-sensitive.
- string · Converts a value to text. Objects and arrays become JSON text.
- strongEquals · Checks whether values of the same type are equivalent. Fails if the types differ.
- sub · Subtracts the second number from the first.
- substring · Returns a set number of characters from a string, starting at a zero-based position.
- subtractFromTime · Subtracts any number of time units from a timestamp.
T
- take · Returns a number of items from the front of an array or string.
- ticks · Returns a timestamp as ticks: 100-nanosecond steps since 1 January 0001.
- toLower · Converts a string to lowercase.
- toUpper · Converts a string to uppercase.
- trigger · Returns the trigger’s object at runtime, including its inputs and outputs.
- triggerBody · Returns the body of the trigger’s output.
- triggerFormDataMultiValues · Returns every value for a key in the trigger’s form-data or form-encoded output.
- triggerFormDataValue · Returns one value for a key in the trigger’s form-data or form-encoded output.
- triggerMultipartBody · Returns one part of a multipart trigger output.
- triggerOutputs · Returns the trigger’s full output, including headers and body.
- trim · Removes spaces from the start and end of a string.
- trimByteOrderMark · Removes a byte order mark (BOM) from the start of text or binary content.
U
- union · Combines collections into one, with duplicates removed.
- uriComponent · URL-encodes a string.
- uriComponentToBinary · Converts a URL-encoded string to binary content.
- uriComponentToString · Converts a URL-encoded string back to text.
- uriHost · Returns the host name of a URL.
- uriPath · Returns the path of a URL.
- uriPathAndQuery · Returns the path and query string of a URL.
- uriPort · Returns the port of a URL.
- uriQuery · Returns the query string of a URL.
- uriScheme · Returns the scheme of a URL, such as https.
- utcNow · Returns the current date and time in UTC, optionally formatted.
V
- variables · Returns the value of a variable.
W
- workflow · Returns details about the running flow, such as its name, run ID and environment.
X
Questions
FAQ
What are expression functions?
Small formulas that transform data inside a flow: format a date, join text, pick a field from a previous step, count items and more. The same functions also work in Azure Logic Apps.
How do I add an expression to a flow?
Click into any input, open the dynamic content panel (or the fx button), choose Expression, type the expression without a leading @, and select Add. In code view, expressions appear wrapped as @{...}.
How do I format a date?
Use formatDateTime with a .NET pattern, for example formatDateTime(utcNow(), 'dd/MM/yyyy'). Remember that utcNow() is in UTC; wrap it in convertTimeZone() to show local time.
How do I stop errors when a field is missing?
Use ?['field'] instead of ['field'] so a missing property returns null instead of failing, and coalesce() to supply a default value.
Why does my comparison never match?
Usually a type or case difference. Convert both sides first: int() or float() for numbers, toLower() for text. A number stored as text is not equal to the number itself.
Descriptions on this site are written independently and simplified for makers. Always check the linked Microsoft Learn page for the complete, current behavior.