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 / "The datetime string m...
Power Automate
Answered

"The datetime string must match ISO 8601 format"

(0) ShareShare
ReportReport
Posted on by 173

I would like to reformat the date to a friendly format.

 

I am getting the error "the value provided for date time string 'Deadline' was not valid. The datetime string must match ISO 8601 format.'." I have a date and time field that shows the deadline in this format "2022-01-14T04:59:00Z". I tried converting timezone, and also using the following format date time: 

formatDateTime('Deadline','yyyy-MM-dd')
 
I understand that an ISO 8601 format is always formatted as yyyy-MM-dd. However, I can't figure out how to fix the reformatting formula. Or maybe it's another issue?
 

Here is my flow:

oaghaei_0-1633399127768.png

 

Here is the error:

oaghaei_1-1633399294225.png

 

 

Categories:
I have the same question (0)
  • Priyae Profile Picture
    Microsoft Employee on at

    Hey @oaghaei ,

    Check the solution here for your need : 

    Solved: Error- The datetime string must match ISO 8601 for... - Power Platform Community (microsoft.com) 

     

    Thanks

  • oaghaei Profile Picture
    173 on at

    Hello @pre - thank you for your response. I tried to formatdate because I thought maybe its a simpler solution: 

    formatDateTime('Deadline','MM/dd/yyyy')

     

    However, when I pipe that into the html table, it gives me the following error. Do you think the solution you are proposing with splitting the date would solve this?

    InvalidTemplate. The execution of template action 'Select' failed: The evaluation of 'query' action 'where' expression '{ "Opportunity Title": "@item()?['Title']", "Deadline": "@formatDateTime('Deadline','yyyy-MM-dd')", "Agency": "@item()?['Agency_x0020__x0028_full_x0020_n/Value']", "Category ": "@item()?['Category/Value']", "Amount": "@item()?['Award']", "Homepage": "@item()?['Homepage_x0020_link']" }' failed: 'In function 'formatDateTime', the value provided for date time string 'Deadline' was not valid. The datetime string must match ISO 8601 format.'.

  • Verified answer
    Ellis Karim Profile Picture
    11,985 Super User 2026 Season 1 on at

    The expression is trying to format the text 'Deadline' as MM/dd/yyyy.

    The expression needs to refer to the SharePoint field Deadline using item()?['Deadline'] in the expression:

    2021-10-05_19-11-21.jpg

    (I'm guessing that the SharePoint field is called Deadline.)


    Ellis

     


    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • oaghaei Profile Picture
    173 on at

    @ekarim2020  Elis, thank you so much! I didn't realize the "item" addition was required. This did it!!! So happy.

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
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard