Skip to main content

Notifications

Community site session details

Community site session details

Session Id : PuVtXwEkZoB8OVbNm5WGhn
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,998 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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 306 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 271 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 249

Overall leaderboard
Loading started