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

Community site session details

Session Id : uhPjHLoW1Ll2HEAzPrZsA1
Power Automate - Building Flows
Answered

Wrong Date Format In CSV

Like (0) ShareShare
ReportReport
Posted on 5 Jul 2023 20:19:33 by 65

I'm getting the wrong date format whenever I export a CSV through a flow.

I have a SharePoint List with two columns (Single Text | Date Only) just like below:

 

ItemsDates
Item_A12/05/2023
Item_B05/03/2023
Item_C24/07/2023

 

I've created a flow to export these two columns whenever there is a new entry or one of the items is modified.

The thing is I will use this CSV to upload it to one of our systems and it only accepts files with dates as mentioned below:

 

Items, Dates
Item_A,12052023
Item_B,05032023
Item_C,24072023

See that Item_A row, 'Dates' were 12/05/2023 and the objective is to get 12052023. The same goes to the other rows.

 

Using the "Create CSV Table" action, I tried something like:

HeaderValue
Itemitem()?['Items']
Datesreplace(string(item()?['Items']),'/','')

 

And then the "Create File" to export the CSV table.

But, instead of getting the desired date format, I get dates with "-" and reversed as seen below:

 

Item,Dates
Item_A,2023-05-12
Item_B,2023-03-05
Item_C,2023-07-24

 

Can someone please help me through a way of formatting the dates correctly?

I have the same question (0)
  • NickMerrick Profile Picture
    419 Super User 2024 Season 1 on 05 Jul 2023 at 20:43:58
    Re: Wrong Date Format In CSV

    YYYY-MM-DD is the correct international business date format, but if you really need it, are the dates in the upload spreadsheet formatted as dates or as a string? If its formatted as a date that explains why its converting to an acceptable date format. If you need it to be read month day year all in one string, make sure the item() is being read as a string, replace the slashes then save it as an integer. That will force excel to see the value as 12052023 instead of May 12th 2023.

  • Verified answer
    trice602 Profile Picture
    14,707 Super User 2025 Season 2 on 05 Jul 2023 at 20:57:22
    Re: Wrong Date Format In CSV

    Hi @Calheiro ,

     

    Looks like this will do it for you - if this works, please mark as a solution so others can find it quickly!  Here, I am selecting my columns using the custom column option and then using the expression helper and feeding it the current format and the desired format, creating file and looks good.  Does this work for you?  Always glad to help!  Tom

     

    dateformatting22.pngdateformatting21.pngdateformatting23.png

  • Calheiro Profile Picture
    65 on 06 Jul 2023 at 11:22:37
    Re: Wrong Date Format In CSV

    It worked exactly as you described! Thank you so much.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard