Advanced expressions and functions in Power Automate
João Barros
18 de November de 2025
1 min read
Power Automate expressions are functions that operate on data at runtime, enabling transformations, conditions and dynamic payload construction without additional actions. They are based on the Azure Logic Apps expression language.
String manipulation
// Concatenate
concat('Hello ', triggerBody()?['name'], '!')
// Replace
replace(body('Get_item')?['email'], '@company.com', '@newdomain.com')
// Extract substring
substring('REF-2024-00123', 4, 4) // → "2024"
// Convert to upper/lower case
toUpper(triggerBody()?['code'])
toLower(triggerBody()?['email'])
// Check if it contains
contains(triggerBody()?['subject'], 'URGENT')
Dates and times
// Today's date formatted
formatDateTime(utcNow(), 'dd/MM/yyyy')
// Add/subtract days
addDays(utcNow(), -30)
addDays(utcNow(), 7)
// Difference between dates (in days)
div(sub(ticks(utcNow()), ticks(variables('start_date'))), 864000000000)
// Start of the current month
startOfMonth(utcNow())
// Convert timezone (UTC → Lisbon)
convertTimeZone(utcNow(), 'UTC', 'GMT Standard Time')
Working with arrays
// First/last element
first(body('List_items')?['value'])
last(body('List_items')?['value'])
// Filter array (no loop)
// Use the "Filter array" action with the expression:
@greater(item()?['amount'], 1000)
// Count elements
length(body('List_items')?['value'])
// Join array into a string
join(variables('email_list'), '; ')
JSON and objects
// Navigate nested JSON
body('Parse_JSON')?['customer']?['address']?['city']
// Build a dynamic object
{
"id": @{triggerBody()?['id']},
"timestamp": "@{utcNow()}",
"processed": true
}
// Check if a property exists
if(equals(triggerBody()?['optional'], null), 'default', triggerBody()?['optional'])
Conclusion
Mastering expressions turns Power Automate from a click-and-drag tool into a serious integration engine. Invest time in date functions, array manipulation and JSON navigation — they appear in 80% of complex flows.