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 / 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
    400 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

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 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,402 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
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 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.

     

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

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

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard