Power Automate how-tos
One question, one answer, and the exact expression or step to copy. Each expression can be checked or changed on the Expressions page; each flow can be opened in AutomateAlong and built alongside you.
Expressions: dates
- How to get today's date in dd/MM/yyyy format in Power Automate
formatDateTime(convertFromUtc(utcNow(), 'GMT Standard Time'), 'dd/MM/yyyy') - How to show the current UK time (HH:mm) in Power Automate
formatDateTime(convertFromUtc(utcNow(), 'GMT Standard Time'), 'HH:mm') - How to add days to a date in Power Automate (addDays)
addDays(utcNow(), 7) - How to get a date 30 days ago for a filter query in Power Automate
formatDateTime(addDays(utcNow(), -30), 'yyyy-MM-dd') - How to get the first day of the month in Power Automate
formatDateTime(startOfMonth(utcNow()), 'yyyy-MM-dd') - How to get the day of the week as a name in Power Automate
formatDateTime(convertFromUtc(utcNow(), 'GMT Standard Time'), 'dddd') - How to make a Power Automate flow run only on weekdays
and(greater(dayOfWeek(convertFromUtc(utcNow(), 'GMT Standard Time')), 0), less(dayOfWeek(convertFromUtc(utcNow(), 'GMT Standard Time')), 6)) - How to check if a date is in the past in Power Automate
less(ticks(items('Apply_to_each')?['DueDate']), ticks(utcNow())) - How to calculate the number of days between two dates in Power Automate
div(sub(ticks(items('Apply_to_each')?['DueDate']), ticks(utcNow())), 864000000000) - How to convert an Excel date number to a date in Power Automate
addDays('1899-12-30', int(items('Apply_to_each')?['Due']), 'dd/MM/yyyy')
Expressions: text
- How to get the name before the @ in an email address in Power Automate
first(split(triggerOutputs()?['body/from'], '@')) - How to use a default value for a blank field in Power Automate
coalesce(triggerBody()?['Notes'], 'No notes given') - How to trim and lower-case text before comparing it in Power Automate
toLower(trim(items('Apply_to_each')?['Email'])) - How to get the first 50 characters of text in Power Automate
substring(variables('Text'), 0, min(50, length(variables('Text')))) - How to add today's date to a file name in Power Automate
concat('Report-', formatDateTime(utcNow(), 'yyyy-MM-dd'), '.xlsx') - How to remove invalid characters from a file name in Power Automate
replace(replace(replace(variables('Name'), '/', '-'), ':', '-'), '?', '') - How to get a file name without its extension in Power Automate
substring(variables('FileName'), 0, lastIndexOf(variables('FileName'), '.')) - How to get a file's extension in Power Automate
toLower(last(split(variables('FileName'), '.')))
Expressions: lists
- How to count the items returned by Get items in Power Automate
length(body('Get_items')?['value']) - How to check if Get items returned nothing in Power Automate
empty(body('Get_items')?['value']) - How to get the first item without Apply to each in Power Automate
first(body('Get_items')?['value'])?['Title'] - How to count the attachments on an email in Power Automate
length(triggerOutputs()?['body/attachments']) - How to pull one column out of a list with Select in Power Automate
item()?['Email'] - How to join a list into comma-separated text in Power Automate
join(body('Select'), ', ')
Expressions: checks
- How to check whether an attachment is a PDF in Power Automate
endsWith(toLower(items('For_each_attachment')?['name']), '.pdf') - How to compare text ignoring capitals in Power Automate
equals(toLower(items('Apply_to_each')?['Status']), 'closed') - How to check if a value is blank in Power Automate (empty)
or(empty(triggerBody()?['Email']), empty(triggerBody()?['Name'])) - How to use a SharePoint Yes/No column in a Condition in Power Automate
equals(items('Apply_to_each')?['Approved'], true) - How to check that text is a whole number before using int() in Power Automate
isInt(trim(triggerBody()?['Quantity']))
Expressions: numbers
- How to format a number as pounds (£) in Power Automate
formatNumber(float(variables('Total')), 'C2', 'en-GB') - How to add 20% VAT to an amount in Power Automate
formatNumber(mul(float(variables('Net')), 1.2), 'C2', 'en-GB') - How to round a number to two decimal places in Power Automate
formatNumber(float(variables('Value')), '0.00') - How to calculate a percentage in Power Automate
formatNumber(div(mul(float(variables('Done')), 100), float(variables('Total'))), '0.0')
Expressions: files and flow
- How to turn an email attachment into file content in Power Automate
base64ToBinary(items('For_each_attachment')?['contentBytes']) - How to get a link to the current flow run in Power Automate
concat('https://make.powerautomate.com/environments/', workflow()?['tags']?['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']?['name']) - How to get the flow's own name in a Power Automate expression
workflow()?['tags']?['flowDisplayName']
Build a flow
- How to save email attachments to SharePoint with Power AutomateWhen an email with attachments arrives, save each PDF into a SharePoint folder and post a message in a Teams channel.
- How to post Microsoft Forms responses to a Teams channel with Power AutomateWhen someone submits a Microsoft Form, post the responder and time in a Teams channel.
- How to build a holiday request approval flow in Power AutomateWhen a holiday request is added to a SharePoint list, ask the requester's manager to approve it and update the item.
- How to email a daily report of open SharePoint items with Power AutomateEvery weekday morning, email a table of open items from a SharePoint list.
- How to move emails to a folder automatically with Power AutomateMove incoming emails with 'invoice' in the subject into an Invoices folder.
- How to send a weekly Teams reminder with Power AutomateEvery Monday at 09:00, send a reminder in Teams chat.
- How to copy Excel rows into a SharePoint list with Power AutomateOn demand, copy every row from an Excel table into a SharePoint list.
- How to extract invoice data from PDFs with AI Builder into ExcelRead PDF invoices from email with AI Builder and log the key fields in an Excel table.
A flow failing instead? The error messages pages explain each one, or paste yours into the Flow Doctor.
AutomateAlong is independent and isn't affiliated with Microsoft. Microsoft and Power Automate are trademarks of the Microsoft group of companies.