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 / Changing Date Format n...
Power Automate
Unanswered

Changing Date Format not applying to some records

(0) ShareShare
ReportReport
Posted on by

I have flow that gets a data from dataverse and puts in into a CSV table to be sent as attachment in email and for saving in One Drive. The issue is I'm changing the DateFormat of one of the columns into the CSV table but after running the flow some of the records are properly formatted into what I put in the expression and some have different formats applied to them. 

 

Power Automate 1.JPG

 

Here's how I used the CSV Table

 

Power Automate 2.JPG

 

And this is how it looks like when the file is generated in one drive and the file attached to the email. 

 

Power Automate 3.JPG

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

    Hi Emad,

    I've created this file also via flow with .csv extension file name using CREATE FILE action from One Drive business. I'll try changing it to xlsx extension to see how it goes. But I need that feature in PowerApps where they can export with csv or xlsx option so if it's messing up in CSV that will cause an issue on my side.

  • EmadBeshai Profile Picture
    806 Moderator on at

    Hi @RazenC ,

     

    I think this is excel file, if it is an excel file please fix the format from the excel template itself not the power automate flow.

     

    If this post helps you with your problem, please mark this answer as Accepted Solution.
    If you like my response, please give it a Thumbs Up.

  • RazenC Profile Picture
    on at

    Sorry. Got lost on this one. I still get the part about switching the MM and mm but do you mean the problem is in the records itself based on how it is formatted? 

     

    I tried removing the HH:mm:ss in the date format with these remaining

    formatDateTime(item()?['cr21b_requirementcreatedate'], 'yyyy-MM-dd')

    but still the results is giving me these formats

    RazenC_0-1698322831370.png

    I'm really lost. 

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    The first example you showed from the initial post had the Minutes in the Months place. 

     

    MM=months

    mm=minutes

     

    Your first example:

    formatDateTime(item()?['cr21b_requirementcreatedate'], 'yyyy-mm-dd HH:MMss')

     

    Notice the MM and mm are switched around.

     

    When this ran through power automate and the CSV - it recognized this as text for most of the datetimes since none of them were actual date times (example 2020-55-21 is not a date). However, some of them did make an actual date time, so the CSV converted it into date format.

     

  • RazenC Profile Picture
    on at

    Hi, Thanks for looking into this. But unfortunately it doesn't solve the issue. 

    After applying the format you've suggested

    formatDateTime(item()?['cr21b_requirementcreatedate'], 'yyyy-MM-dd HH:mm:ss')

    There are no records that are not updated or have different format but the results became this.

     

    Result 1.JPG

     

    Just for additional info. I tried removing the date format and it looks like this. 

    Result 3.JPG

     

    This is how it looks like in Dataverse.

     

    Result 2.JPG

     

    Actually I'm also putting this in a HTML table to be sent in an email. But it doesn't cause any issues

     

    Result 4.JPGResult 5.JPG

     

    Really confused why this works and not in CSV table. 

  • v-yueyun-msft Profile Picture
    on at

    Hi, @RazenC 

    According to your screenshot , you are using the formatDateTime() function to get the format of the date.\

    You can try to use the 'yyyy-MM-dd HH:mm:ss'  to test .

    For more information, you can refer to :
    Custom date and time format strings - .NET | Microsoft Learn

    I test it in my side , it works good where the column in my dataverse columnn type is "DateTime":

    vyueyunmsft_0-1698212768997.png

    The result is as follows:

    vyueyunmsft_1-1698212816439.png

     

     

    Second, you can check that the date format you have the problem with is the same as the date format returned correctly. You can check this in the output in above action.

    You can compare the difference between the correct and incorrect values in the results returned in the previous step.

     

    If this still doesn't help you solve the problem, you can provide me with some format data in Dataverse that has problems, along with your expected output, so that I can better help you.

     

    Best Regards,

    Yueyun Zhang

     

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
David_MA Profile Picture

David_MA 265 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 203 Most Valuable Professional

#3
trice602 Profile Picture

trice602 202 Super User 2025 Season 2

Last 30 days Overall leaderboard