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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Correction Required fo...
Power Automate
Answered

Correction Required for Date Format Error in the flow

(1) ShareShare
ReportReport
Posted on by 2

 

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

 

Categories:
I have the same question (0)
  • Tristan_D Profile Picture
    405 on at

    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

  • Manish Solanki Profile Picture
    15,167 Moderator on at

    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.

     

  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

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

  • MIA27 Profile Picture
    2 on at

    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

     

  • Verified answer
    Manish Solanki Profile Picture
    15,167 Moderator on at

    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.

     

  • Manish Solanki Profile Picture
    15,167 Moderator on at

    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.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard