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 Apps / Wrong date format when...
Power Apps
Answered

Wrong date format when submitting Power App entry to SHP list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have an issue with a flow, when I am sending the data, which is entried in a Power App, to a SharePoint Library. The date entry gets formatted in the wrong way and switches the day and the month. 

 

This is the entry in the Power App, which is the 8th of June.

PhilippZu_0-1623132514406.png

However, the following screenshot shows the date which gets posted in the library thereafter, which is the 6th of August.

PhilippZu_1-1623132562935.png

 

As shown in the flow output below, the created date is still holding the correct date but the file date gets somehow converted and switches day and month.

 

PhilippZu_3-1623132733550.png

 

I am assuming this is an issue with date and time formatting in Power Apps, Flow or Sharepoint but I haven't figured out exactly where the problem is. Could you please help me out with that matter?

Thanks a lot in advance! 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Is the date of files in the sp library or the date of items in the sp list wrong?

    Could you provide some formulas or screenshots of the flow?

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-xiaochen-msft ,

     

    the date is wrong in the SHP library. 

     

    I am converting the date from power app to a string and store it in a variable. Here the date is still correct (8th of June, which is equal to the entry in power apps)

    PhilippZu_0-1623138537610.png

     

    However, in the library it stores the 6th of August (06.08.2021 instead of 08.06.2021 > month and date get switched).

     

    This is what happens next

    PhilippZu_1-1623138706189.png

     

    Here, when I update the properties of the created file, this is what happens in the code: the "created date" is still correct, but the "File Date" (the column in the library) changes month and date.

    PhilippZu_2-1623138777671.png

     

    Does this help?

     

    Regards

     

     

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    The value you enter is a string, and flow  automatically converted it to a date value and reverse the date and month.

    So ,please use formatDateTime  function:

     
    formatDateTime(variables('Thevar'),'dd-MM-yyyy')
     
    v-xiaochen-msft_0-1623140961365.png

     

    v-xiaochen-msft_1-1623140994573.png

     

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-xiaochen-msft ,

     

    thanks, this helped! However, when the day is after the 12th of a month, I get an error message again (possibly, since it would primarly assume, that the day is the month and there exists only months from 1 to 12). This is the error message that gets displayed:

     

    Template language expressions in the entries of the action "FileProperties_Update" in row "1" and column "13965" cannot be processed: An invalid value was specified for the date/time string "13.06.2021" in the function "formatDateTime". The datetime string must comply with the ISO 8601 format....

     

    Thanks a lot for your help!

     

    Best regards

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I did a test for you.

    v-xiaochen-msft_0-1623145329126.png

     

    split(variables('Thevar'),'.')
     
    variables('Thevar2')[1].variables('Thevar2')[0].variables('Thevar2')[2]

     

    formatDateTime(outputs('Compose'),'MM-dd-yyyy')
     
    v-xiaochen-msft_1-1623145423512.png

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard