Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Correction Required for Date Format Error in the flow

(1) ShareShare
ReportReport
Posted on by

 

I have a flow which is coming from power app click button, It bring the Json data, So I am  select data operation method to apply the column with some formatting, All is working fine but Date format function is producing error. 

 

Could not understand the mistake in the expression below

formatDateTime(item()?['SvcDate'],'MMM/dd/yyyy')

 

Below is the images of my flow, error and its related screen

 

My Flow:

MIA27_1-1720509689686.png

 

 

 

 

The execution of template action 'Select_Data_Method' failed: The evaluation of 'query' action 'where' expression '{
"Record No": "@item()?['RecoNo']",
"Svc Date": "@formatDateTime(item()?['SvcDate'],'MMM/dd/yyyy')",
"Model": "@item()?['Model']",
"Serial No": "@item()?['SerialNo']",
"Svc SMR": "@item()?['SvcSMR']",
"Svc Remarks": "@item()?['SvcRemarks']",
"Svc Expense": "@formatNumber(item()?['SvcExpense'],'0.00')",
"Customer": "@item()?['Customer']"
}' failed: 'In function 'formatDateTime', the value provided for date time string '26-01-2024' was not valid. The datetime string must match ISO 8601 format.'.

MIA27_0-1720509566284.png

 

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Correction Required for Date Format Error in the flow

    Pls try this one, I have added check for null or empty values in the expression:

    if(empty(item()?['SvcDate']),'',formatDatetime(concat(last(split(item()?['SvcDate'],'-')),'-',join(take(skip(reverse(split(item()?['SvcDate'],'-')),1),2),'-')),'MMM/dd/yyyy'))

     

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Correction Required for Date Format Error in the flow

    Pls try this one, I have added check for null or empty values in the expression:

    if(empty(item()?['SvcDate']),'',formatDatetime(concat(last(split(item()?['SvcDate'],'-')),'-',join(take(skip(reverse(split(item()?['SvcDate'],'-')),1),2),'-')),'MMM/dd/yyyy'))

     

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • MIA27 Profile Picture
    on at
    Re: Correction Required for Date Format Error in the flow

    I tried your advise expression (copied and pasted in the expression, the flow failed, below is the failed detail result.

    Kindly check and advise

     

    MIA27_0-1720522188813.pngMIA27_1-1720522280758.png

     

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on at
    Re: Correction Required for Date Format Error in the flow

    @MIA27 - I think you will need to reformat the DateString -See solution below:

    CFernandes_0-1720517385240.png

     

     

    Expressions:

     

    • split(outputs('Compose_1'),'-')
    • formatDateTime(concat(outputs('Compose_3')[1],'/',outputs('Compose_3')[0],'/',outputs('Compose_3')[2]),'MMM/dd/yyyy')
       
       

      If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

       

      P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Correction Required for Date Format Error in the flow

    Hi @MIA27 

     

    Function formatDatetime accepts date in ISO format (yyyy-MM-dd) but the input date is not in that format. You can try below expression, assuming input date is always return as 'dd-MM-yyyy'

    formatDatetime(concat(last(split(item()?['SvcDate'],'-')),'-',join(take(skip(reverse(split(item()?['SvcDate'],'-')),1),2),'-')),'MMM/dd/yyyy')

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • Tristan_D Profile Picture
    388 on at
    Re: Correction Required for Date Format Error in the flow

    Hi @MIA27 !

    Could you try to use this function instead ?

    "Svc Date": "@formatDateTime(item()?['SvcDate'],'dd/MM/yyyy')",


    Let me know if it helps.

    T

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

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

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492