Showing results for 
Search instead for 
Did you mean: 
Not applicable

Formatting a date field that is conditionally displayed

I am having trouble formatting and printing a date field in an e-mail.


The date field in question only needs to be entered and displayed on the e-mail if a date has been entered, and I want the date formatted into dd-MM-yyyy instead of the default yyyy-mm-dd format


I have tried the following expression, but I keep getting an error saying that the expression is invalid:


However the following expression (without the date formatting) works:

Super User III
Super User III


There is a typo in the WDL function name

formatedatetime ->formatdatetime


If the problem persists, please share triggerBody()?['EndDate'] contant that make the expression fail


Hope this saves your day

Each time you click on any of our inspiring answers 'Thumb up' icon... ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!

Escribo sobre Power Automate en:

Proud to be a Flownaut!

Good catch!



If not, try with  formatDateTime(item()?['EndDate'], 'dd-MM-yyyy')

Helpful resources

Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (34,020)