Power Automate Formatting Cheat Sheet
formatDateTime, convertTimeZone, formatNumber — these expressions handle 90% of formatting needs in Power Automate. Here's the syntax, common format strings, and fixes for the errors that come up.
Every flow eventually needs to format a date for an email subject, convert a UTC timestamp to the user’s time zone, or turn a number into a currency string. Power Automate has expressions for all of this, but the syntax isn’t intuitive and the error messages aren’t helpful.
Here’s a reference for the formatting expressions you’ll actually use.
Formatting Dates with formatDateTime
The basic syntax:
formatDateTime(triggerOutputs()?['body/createdon'], 'yyyy-MM-dd')
This outputs something like 2026-03-28.
Common Format Strings
| Format String | Output Example | Notes |
|---|---|---|
yyyy-MM-dd | 2026-03-28 | ISO date, good for file names |
MM/dd/yyyy | 03/28/2026 | US date format |
dd/MM/yyyy | 28/03/2026 | European format |
MMMM dd, yyyy | March 28, 2026 | Human-readable |
MMM dd | Mar 28 | Short month |
yyyy-MM-dd HH:mm | 2026-03-28 14:30 | Date and 24-hour time |
hh:mm tt | 02:30 PM | 12-hour time with AM/PM |
dddd | Saturday | Day of week name |
HH:mm:ss | 14:30:00 | Time only (24-hour) |
Important: MM is month, mm is minutes. Mix these up and you’ll get wrong results with no error message.
Format Characters Quick Reference
yyyy— 4-digit yearyy— 2-digit yearMM— 2-digit month (01-12)MMM— Abbreviated month (Jan, Feb)MMMM— Full month name (January, February)dd— 2-digit day (01-31)dddd— Full day name (Monday, Tuesday)HH— 24-hour hour (00-23)hh— 12-hour hour (01-12)mm— Minutes (00-59)ss— Seconds (00-59)tt— AM/PM
Converting Time Zones
Dataverse stores all dates in UTC. If your flow sends an email saying “Your meeting is at 2026-03-28T14:00:00Z,” the user gets confused because that’s not their local time.
Use convertTimeZone:
convertTimeZone(
triggerOutputs()?['body/scheduledstart'],
'UTC',
'Eastern Standard Time'
)
To format the result at the same time, wrap it in formatDateTime:
formatDateTime(
convertTimeZone(
triggerOutputs()?['body/scheduledstart'],
'UTC',
'Eastern Standard Time'
),
'MMMM dd, yyyy hh:mm tt'
)
Output: March 28, 2026 10:00 AM
Time Zone Names
Use the Windows time zone IDs. Common ones:
| Time Zone | ID |
|---|---|
| US Eastern | Eastern Standard Time |
| US Central | Central Standard Time |
| US Pacific | Pacific Standard Time |
| UK | GMT Standard Time |
| Central Europe | Central European Standard Time |
| India | India Standard Time |
| Australia Eastern | AUS Eastern Standard Time |
These IDs handle daylight saving time automatically — Eastern Standard Time correctly returns EDT during summer months.
Date Math: Adding and Subtracting
Add Days
addDays(utcNow(), 7)
Returns the date 7 days from now. Use negative numbers to go backward:
addDays(utcNow(), -30)
Add Hours, Minutes
addHours(utcNow(), 3)
addMinutes(utcNow(), 45)
Subtract Time with subtractFromTime
subtractFromTime(utcNow(), 2, 'Hour')
subtractFromTime(utcNow(), 30, 'Day')
Add Time with addToTime
addToTime(utcNow(), 1, 'Month')
addToTime(utcNow(), 1, 'Year')
Getting Start and End of Day
Start of today:
startOfDay(utcNow())
Start of the month:
startOfMonth(utcNow())
Formatting Numbers
formatNumber for Currency and Decimals
formatNumber(12345.6, 'C', 'en-US')
Output: $12,345.60
formatNumber(12345.6, 'C', 'de-DE')
Output: 12.345,60 €
Fixed Decimal Places
formatNumber(42.5, 'N2')
Output: 42.50
formatNumber(42.5, 'N0')
Output: 43 (rounded, no decimals)
Common Format Specifiers
| Specifier | Example Input | Output | Meaning |
|---|---|---|---|
C | 1234.5 | $1,234.50 | Currency (locale-dependent) |
N2 | 1234.5 | 1,234.50 | Number with 2 decimal places |
N0 | 1234.5 | 1,235 | Number with no decimals |
P | 0.85 | 85.00% | Percentage |
P0 | 0.85 | 85% | Percentage, no decimals |
Padding Numbers with Leading Zeros
To turn 5 into 005:
formatNumber(5, 'D3')
Output: 005
This is useful for invoice numbers, ticket IDs, and similar sequential values.
Parsing Strings into Dates
If you receive a date as a string from an external system:
formatDateTime('2026-03-28', 'MMMM dd, yyyy')
Power Automate can usually parse ISO format strings directly. For non-standard formats, you may need to extract parts with substring() and rebuild the date.
Common Mistakes and How to Fix Them
”InvalidTemplate” or “Unable to process template language expressions”
This almost always means your expression has a syntax error. Common causes:
- Missing closing parenthesis
- Using smart quotes (curly quotes) instead of straight quotes — don’t compose expressions in Word or Outlook
- A null value being passed to formatDateTime — wrap with a condition or use
coalesce()first
Date Shows Wrong Time (Off by Several Hours)
You’re displaying a UTC timestamp without converting it. All Dataverse dates are UTC. Always use convertTimeZone() before displaying times to users.
MM vs mm Confusion
formatDateTime(utcNow(), 'yyyy-mm-dd') gives you 2026-30-28 (minutes instead of months). Use uppercase MM for months, lowercase mm for minutes.
formatNumber Returns an Error on Text Values
formatNumber requires an actual number, not a string that looks like a number. If your value comes from a text field or parsed JSON, convert it first:
formatNumber(float(body('Parse_JSON')?['amount']), 'C', 'en-US')
addDays Returns a Timestamp, Not Just a Date
addDays(utcNow(), 7) returns a full timestamp like 2026-04-04T14:30:00.0000000Z. If you just want the date portion, wrap it:
formatDateTime(addDays(utcNow(), 7), 'yyyy-MM-dd')
Locale-Specific Currency Formatting
formatNumber(1234, 'C') without a locale argument uses the flow’s default locale, which might not match what your users expect. Always pass the locale explicitly:
formatNumber(1234, 'C', 'en-US') // $1,234.00
formatNumber(1234, 'C', 'en-GB') // £1,234.00
Related articles
Your First Approval Flow
A step-by-step guide to building approval flows in Power Automate, including connector provisioning, approval types, custom email content, and handling the response — plus the errors that block most first-time setups.
Calling Power Automate from a Canvas App (And Getting Data Back)
Calling a flow from a canvas app is straightforward once you get the trigger right. Here's how to set up inputs, return data to the app, and fix the issues that come up when the two don't talk to each other.
How to Send Emails with Attachments in Power Automate (Without 0KB Files)
Getting email attachments right in Power Automate is trickier than it looks. Here's how to attach files from SharePoint, Dataverse, and other sources without ending up with empty 0KB files.