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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need help formatting d...
Power Automate
Answered

Need help formatting date (MM/dd/yyyy) for my Application

(0) ShareShare
ReportReport
Posted on by

Hey guys,

 

I am trying to format the date for my "Select" Action. It displays the year as 2021-11-27 instead of 11/27/2021.

I have tried: formatDateTime('Date_x0020_out_x0020_of_x0020_th', MM/dd/yyyy)

 
But I end up with the following error message:
"The execution of template action 'Select' failed: The evaluation of 'query' action 'where' expression '{
"Staff Member": "@item()?['Staff_x0020_Name/Value']",
"Date Out of Office": "@formatDateTime('Date_x0020_out_x0020_of_x0020_th', 'MM/dd/yyyy')"
}' failed: 'In function 'formatDateTime', the value provided for date time string 'Date_x0020_out_x0020_of_x0020_th' was not valid. The datetime string must match ISO 8601 format."
 
The date is converted earlier in the app in the "Get Items" action using the Filter Query and it displays correctly. When it goes to the "Select" action it shows again as 2021-11-27. This is the expression that I used:
"formatdatetime(convertFromUtc(utcnow(),'Central Standard Time'),'MM-dd-yyyy')"

 

        "Staff_x0020_Name": {
                "@odata.type""#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                "Id"3,
                "Value""John Smith"
             "Staff_x0020_Name#Id"3,
            "Date_x0020_out_x0020_of_x0020_th": "2021-11-27",
 
joe904_1-1638057315108.png
joe904_2-1638057365538.png

 

joe904_3-1638058735789.png

 

I appreciate any help you can give me.

Categories:
I have the same question (0)
  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Hi!
    I would try with the following expression:

    formatDateTime(item()?['Date_x0020_out_x0020_of_x0020_th'], 'MM/dd/yyyy')

    Hope this helps

  • Community Power Platform Member Profile Picture
    on at

    Thank You so much!!

  • Community Power Platform Member Profile Picture
    on at

    SO I ran the app with no problem and it worked as expected. I then began to get error messages later on for some reason. Can you please help me?

    joe904_0-1638092875083.png

    joe904_1-1638092961849.png

     

     

  • efialttes Profile Picture
    14,756 on at

    @Anonymous 
    I would doublecheck if 'Central Standard Time' is between the values allowed by Microsoft. You will find the full list in the following link
    Default Time Zones | Microsoft Docs
    If the problem persist, my suggestion is to open a new thread following the rule 'one issue, one topic', the reason is unattended, unsolved topics attrack the attention of more superusers, and this one already have several responses.
    Thanx for your help making this community great!

  • Community Power Platform Member Profile Picture
    on at

    It worked with no problem before I made the change that you suggested. I just re-added the original dynamic value and it did not throw any errors. It has to be some correlation between what you suggested and the filter query code of the "Get Items" action. It obviously does not play well together. I really do appreciate any help you can give me.

     

    joe904_0-1638119604269.png

    joe904_1-1638119929802.png

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 291 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 238 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 109 Super User 2026 Season 1

Last 30 days Overall leaderboard