cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
oaghaei
Helper III
Helper III

"The datetime string must match ISO 8601 format"

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Community Champion
Community Champion

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.

View solution in original post

4 REPLIES 4
pre
Community Support
Community Support

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

ekarim2020
Community Champion
Community Champion

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.

View solution in original post

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

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,755)