Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 48WvjNjnCmnTZtRNArBmM/
Power Automate - Building Flows
Answered

"The datetime string must match ISO 8601 format"

Like (0) ShareShare
ReportReport
Posted on 5 Oct 2021 02:04:27 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

 

 

  • oaghaei Profile Picture
    173 on 05 Oct 2021 at 18:21:57
    Re: "The datetime string must match ISO 8601 format"

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

  • Verified answer
    Ellis Karim Profile Picture
    10,940 Super User 2025 Season 1 on 05 Oct 2021 at 18:18:15
    Re: "The datetime string must match ISO 8601 format"

    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 05 Oct 2021 at 17:14:17
    Re: "The datetime string must match ISO 8601 format"

    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.'.

  • Priyae Profile Picture
    on 05 Oct 2021 at 04:01:35
    Re: "The datetime string must match ISO 8601 format"

    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

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 61

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 47 Super User 2025 Season 1

#3
rzaneti Profile Picture

rzaneti 31 Super User 2025 Season 1

Overall leaderboard
Loading started