web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trouble with FormatDat...
Power Automate
Answered

Trouble with FormatDateTime

(0) ShareShare
ReportReport
Posted on by 287

I have a flow posted here where I am pulling a record from the Microsoft Dataverse (cr014_neededinhands).

The field is a date/time field and I believe stores the date in ISO 8601 format.

 

I simply want to convert the date in my HTML table to a more readable format by the end user but am getting this error message.

 

The execution of template action 'CheckShipDatesHTMLTable' failed. The column values could not be evaluated: 'In function 'formatDateTime', the value provided for date time string 'cr014_neededinhands' was not valid. The datetime string must match ISO 8601 format.'

 

The only thing I can think is maybe the value is null in some of the fields?  If so, how could I write the expression to consider this?

 

astrontelstar_0-1625500106600.png

 

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,868 Most Valuable Professional on at

    Hi @astrontelstar,


    Can you try this expression instead?

    formatDateTime(item()?['cr014_neededinhands'], 'g')
  • astrontelstar Profile Picture
    287 on at

    It worked!  Thank you.  Can you explain why it worked?  I'd like to understand the add of item()?

  • Expiscornovus Profile Picture
    33,868 Most Valuable Professional on at

    Hi @astrontelstar,

     

    That is a way to refer to a property of an item in a select mapping.

     

    All of your fields in that select action are using that same item()?['fieldname'] syntax. Just hover over one of the other ones and you will see it in the tooltip 😉

     

    refertoproperty.png

     

    Or use the peek code in the settings of the select action. Over there you can also see that the other key value mappings use the same kind of expressions.

     

    peekcodeselect.png

     

  • astrontelstar Profile Picture
    287 on at

    What if the value is null?  Flow dies if the value is null using this expression.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard