Skip to main content

Notifications

Community site session details

Community site session details

Session Id : IZC2baQRwGItEvrGo8nnnS
Power Automate - Building Flows
Answered

String was not recognized as a valid DateTime. Creating query failed

Like (0) ShareShare
ReportReport
Posted on 28 Apr 2023 05:09:56 by 53

I am following https://www.youtube.com/watch?v=g_SqkW9ZCR0&t=199s which is very straightforward but I am getting error message found in title.

 

Screenshot 2023-04-28 at 12.57.46 PM.png

I have double checked the spelling of the variable OpenDate. I am not sure why it is throwing the error? Thanks.

 

 

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on 28 Apr 2023 at 07:08:51
    Re: String was not recognized as a valid DateTime. Creating query failed

    Hi @mclim 

     

    It does not matter to which location you belong because internally SharePoint store the date in UCT format, please try the below expression:

    formatDateTime(utcNow(),'yyyy-MM-dd')

    or you may directly put date in format (yyyy-MM-dd) i.e '2023-04-28' and check the flow result.

     

    Thanks

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • mclim Profile Picture
    53 on 28 Apr 2023 at 06:57:22
    Re: String was not recognized as a valid DateTime. Creating query failed

    @v-peijunz-msft , I received a bad request as shown in my first screenshot. However, the error message is different from yours. I attach a screenshot showing the 'Open Date' . My error message is "String was not recognized as a valid DateTime". However, in Settings column, I confirm it's a 'Date' only.

     

    Please let me know if  you have other suggestions. Thank you!

  • v-peijunz-msft Profile Picture
    Microsoft Employee on 28 Apr 2023 at 06:13:04
    Re: String was not recognized as a valid DateTime. Creating query failed

    Hi @mclim 

     

    Could you please show the error message you received in the Get items in detail?

     

    Based on your description, I have made a simple test for your reference.

    1. I have a Date and time column with the date showing here:

    vpeijunzmsft_1-1682662010835.png

    Here is the flow:

    vpeijunzmsft_2-1682662040977.png

    After running the flow, it got the result here:

    vpeijunzmsft_3-1682662086774.png

     

    But when I use the wrong internal column name in SharePoint list, I got the error message "BadRequest.":

    vpeijunzmsft_0-1682661956469.png

    So I guess the possible reason that you get the error may be the wrong internal column name for your Open Date column used in the filter query.

     

    Please check the correct internal column name by going to your SharePoint list > Settings >List Settings > Choosing the Open Date column, and the correct name format is showed in the last part of the URL:

    vpeijunzmsft_4-1682662362760.png

     

    Hope it helps.

     

    Best regards,

    Sylvia

  • mclim Profile Picture
    53 on 28 Apr 2023 at 05:43:57
    Re: String was not recognized as a valid DateTime. Creating query failed

    Screenshot 2023-04-28 at 1.38.20 PM.png

    @ManishSolanki , in the youtube video screenshot, it uses 'MM/dd/yyyy' which is the US regional date format. So it works without your format of 'yyyy-MM-dd' . But I'm in Malaysia which uses 'dd/MM/yyyy'. And as I have pointed out in the first reply, the format is also 'dd/MM/yyyy'. Thank you.

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on 28 Apr 2023 at 05:35:01
    Re: String was not recognized as a valid DateTime. Creating query failed

    Hi @mclim 

     

    You need to format the date column using the below expression:

    ManishSolanki_0-1682659977056.png

     

    expression used for formatting date is mentioned below:

    formatDateTime(utcNow(),'yyyy-MM-dd')

    assuming, OpenDate stores only date but does hold time.

     

    Pls let me know if you face any problem & remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • mclim Profile Picture
    53 on 28 Apr 2023 at 05:34:12
    Re: String was not recognized as a valid DateTime. Creating query failed

    Screenshot 2023-04-28 at 1.14.37 PM.png

    This is OpenDate as screenshot from the the List. 

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

#1
WarrenBelz Profile Picture

WarrenBelz 146,763 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard