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 / Convert csv Files from...
Power Automate
Answered

Convert csv Files from a folder to Excel .xlsx

(0) ShareShare
ReportReport
Posted on by 49

There are CSV files in a folder which need to be converted to .xlxs.

 

I have map the process as  but it fails to save the file on Particular folder .

any support will be highly appreciated.

 

Hana123TEI_0-1639481104950.png

 

Regards,

**bleep**al.

 

 

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Hi,

     

    1. Can you check the extension in Close Excel and see what happens.

    It is currently showing xlxs, whereas it should be xlsx.

     

    2. And Also there is no file name after the \.

    It is only showing BCS Alert\.xlxs

     

    Make it BCS Alert\file_name_here.xlsx

     

     

     

  • Hana123TEI Profile Picture
    49 on at

    Hi, 

     

    The Problem is there are more than 2 csv files  in the folder , hence I loop , The file name should be same as per the file name of the document ,I tried to do as per you mentioned it run but the file is not saves as xlsx.

     

    Regards,

    **bleep**al. 

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    So, 1) above, you would be overwriting the first file with the second one, because the Save As filename isn't dynamic.  2) ".xlsx" is already declared in the 'Document format' parameter of the "Close Excel", so we do not want to also put it in the 'Document path' parameter, this will cause it to double up.

     

    Here is what we want Close Excel to look like: 

    MichaelAnnis_0-1639575397334.png

    All variables have properties.  In this example, %CurrentItem% is a 'File' variable type.  I keep this link saved on my desktop for reference:
    https://docs.microsoft.com/en-us/power-automate/desktop-flows/datatype-properties

     

    It lists all properties for all variable types, here is a snippet from files:

    MichaelAnnis_1-1639575583361.png

    So, '%CurrentItem.Directory% is the same folder that you got the file from, and %CurrentItem.NameWithoutExtension% is just that.  Don't forget the "\" between the two.

     

    If you have any trouble, let me know.

  • Hana123TEI Profile Picture
    49 on at

    Hello, 

     

    above mentioned will work but it is saving the file on the same path, hence I added the path and then the logic as given you but then its not work. Thanks in advance if you help on saving the file on other path in such case.

     

    Regards,

     

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Do you want them all to go to a single folder, or do you need to decide which folder to go to based off another rule?  If they all go to a single folder, you should be able to just write that into the Close Excel.  ex.  C:\Users\Documents\%CurrentItem.NameWithoutExtension%

    If that doesn't work, try trading out all the "\" for "\\"

    Depending on where you are at "\" is a special character and it requires 2 to make 1.

     

     

  • Hana123TEI Profile Picture
    49 on at

    Hi Michael,

     

    I have to save all these file in same location .

    I did as you mentioned the flow also works but the file is not saved on that location , whereas I tried putting \\

    but it not accept 

    Hana123TEI_0-1640071180917.png

    Regards,

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    That should work, assuming D:\ is a valid location.  You could save back to the current directory and then try moving it to 😧 with 'move files', but my guess would be something is not mapping to the D:.  Most D:s are designated for cd/disc drives.  Is your 😧 a network drive by any chance?  Several users have reported that when trying to save to a network drive, they have to save to the actual server name (ex. NETWORK\\) instead of the mapped network drive (ex. N:\).  Good luck!

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard