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 / Date conversion from C...
Power Automate
Answered

Date conversion from CSV to SharePoint

(0) ShareShare
ReportReport
Posted on by 10

Hello everyone! I'm working on a flow that aims to migrate records to a sharepoint list.

 

The flow follows the following steps:
1. Receive the CSV file
2. Rebuild the files with a 'Select'
3. Iterate over each record with an 'Apply to each'
4. Apply a series of filters.
5. Save the current record in a variable of type array ('registroArrayFecha').
6. Format the date1
7. Format the date2
8. Evaluate which date is larger with a condition.
9. Create item in sharepoint list and export the record.

 

The structure of the record saved in the variable ('registroArrayFecha') would be something like this:

 

 

 

[
 {
 "Resource Name": "User, Name",
 "Work Order": "17992541",
 "Work Country": "Spain",
 "Start Date": "21-2-23",
 "Created Date": "9-2-23",
 }
]

 

 

 

 

The first problem occurs in point 6, when I try to extract the value of 'Start Date' from the variable 'registroArrayFecha' and give it a format to be able to later evaluate this date in a condition.

 

The expression I use to give this format is the following: (This expression is inside a 'Compose')

 

 

 

formatDateTime(concat('20',
split(variables('registroArrayFecha')[0]['Start Date'], '-')[2], '-',
split(variables('registroArrayFecha')[0]['Start Date'], '-')[1], '-',
split(variables('registroArrayFecha')[0]['Start Date'], '-')[0]),
'dd-MM-yyyy')

 

 

 

The error occurs in certain records. On the one hand we have records in which the date is maintained, for example:

Correct conversionCorrect conversion

 

And on the other hand we have records in which we obtain a completely different Compose output, example:
Incorrect conversionIncorrect conversion

 

Entry dates always come in 'dd-MM-yyyy' format.

To summarize, I can't get all the dates to import in the same format so I can evaluate them.

Categories:
I have the same question (0)
  • Verified answer
    SamLed Profile Picture
    2,340 Moderator on at

    Hi @usernull_1234,

     

    You should use parseDateTime() function:

     

    SamLed_0-1708118401676.png

     

    Results without specifying any format (ISO 8601 compliant by default) :

    SamLed_1-1708118472317.png

     

    [Edit] found a nice article explaining this function and providing a list for locales: Power Automate ParseDateTime Function Explained (zeitgeistcode.com)  

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

     

     

  • usernull_1234 Profile Picture
    10 on at

    Hi @SamLed,

     

    Thank you very much for the response, very useful!

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 Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard