Skip to main content
Community site session details

Community site session details

Session Id : 3xC06XZoCOc0NjB5h4p35Y
Power Automate - Building Flows
Answered

In MS Flow is it possible to convert CSV into Excel

Like (0) ShareShare
ReportReport
Posted on 21 Apr 2022 04:44:34 by 3,552 Super User 2025 Season 2

Hi All,

I have Some scenario i need to convert csv file into Excel file, without using premium connectors like Encodian and Plumsail Documents connector.

If anyone knows better solution let me know.

 

Thanks,

Ahammad Riyaz

  • takolota1 Profile Picture
    4,898 Moderator on 19 Oct 2022 at 21:14:12
    Re: In MS Flow is it possible to convert CSV into Excel

    You can now try automatically converting most CSVs to a new Excel table with the same column names as the CSV headers with this template: 

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/CSV-To-New-Excel-Table/m-p/1826096#M964

  • Riyaz_riz11 Profile Picture
    3,552 Super User 2025 Season 2 on 22 Apr 2022 at 04:40:30
    Re: In MS Flow is it possible to convert CSV into Excel

    Yes, for me column name will be constant.

  • Paulie78 Profile Picture
    8,416 Moderator on 21 Apr 2022 at 17:11:47
    Re: In MS Flow is it possible to convert CSV into Excel

    Hi @Ahammad_Riyaz great to hear you were able to use my blog post to help you.

     

    You might also want to check this one out to make your flow more efficient when putting the data into Excel:

    https://www.tachytelic.net/2021/08/power-automate-export-to-excel/ 

  • Rhiassuring Profile Picture
    8,688 Moderator on 21 Apr 2022 at 16:48:27
    Re: In MS Flow is it possible to convert CSV into Excel

    @Ahammad_Riyaz  That solution will only work for you if you have the same column titles in your CSV every time. Is that the case? 

  • Verified answer
    Riyaz_riz11 Profile Picture
    3,552 Super User 2025 Season 2 on 21 Apr 2022 at 12:21:34
    Re: In MS Flow is it possible to convert CSV into Excel

    Hi All,

    Thanks for all your responses.

    I got the solution from this link, https://www.tachytelic.net/2021/02/power-automate-parse-csv/

    Not much steps to follow.

  • Rhiassuring Profile Picture
    8,688 Moderator on 21 Apr 2022 at 07:49:35
    Re: In MS Flow is it possible to convert CSV into Excel

    Hi @Ahammad_Riyaz 

    Yes, this is achievable - I spent way too long testing this out on my side, haha.  I am tired, so this is going to be a quick screenshot dump - with probably a lot of inelegance, as I was just going for function!

    My demo CSV...

    Rhiassuring_0-1650517025713.png

    Rhiassuring_1-1650517036193.png

     

    To start, we get the File Content from your CSV file.
    Then, we start processing the File Content. I used these actions:

     

    Rhiassuring_1-1650526810847.png

     

     

    Split by NewLine: I'm replacing the newlines with a dollar sign, and then splitting on them.

    split(replace(outputs('Get_file_content_using_path')?['body'],decodeUriComponent('%0D%0A'),'$'),'$')

    Filter array - remove nulls: just what it sounds like. Looking at Compose - Split by NewLine's outputs:
    @equals(empty(item()), false)

    Compose - get array header values and split on comma
    split(first(body('Filter_array_-_remove_nulls')),',')

    Compose - array without the header values
    skip(body('Filter_array_-_remove_nulls'),1)
     
    Now that we have that going, time to set up the Excel doc.
     
    Create an Excel file, create a Table (using a variable so you have the name, and setting the range to A1), then we use our previous Compose to get the column names, and drop them into the field.

    (Note: in my test I did it in a dumb way, so no screenshots, but what you'd do here is just turn your "Compose - get array header values and split on comma" into a string variable and plop them in there.

    Now, from here, it's pandemonium

    In an "Apply to each", I am using the Outputs from "Compose - array without headers..". 

    First, I split them by comma so I have them individually. 

    Then, in another "Apply to Each" focused on the output from that split, I use the Append to String to build out my values. I set it to 
    "outputs('Compose_-_Get_array_header_values_and_split_on_comma')[variables('intIncrement')]": "outputs('Compose_-_Clean_out_the_other_linebreak')" and then I increase my intIncrement by 1. I use that to ensure it goes into the right column.
     
    Rhiassuring_2-1650527116837.png

     

    Rhiassuring_3-1650527304816.png

    Theeeeeeen before the Apply to Each starts over for another row, I clear the vars. 

     

    Rhiassuring_4-1650527344239.png

     

    I think the Office Script that @tom_riha mentioned sounds better, but, this was still fun to try.

    R

  • tom_riha Profile Picture
    10,127 Most Valuable Professional on 21 Apr 2022 at 07:17:10
    Re: In MS Flow is it possible to convert CSV into Excel

    Hello @Ahammad_Riyaz ,

    @DamoBird365 has a video where he does that using Office scripts: https://www.youtube.com/watch?v=ZejstvPiFZw

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading started