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 / Rename File Using Exce...
Power Automate
Unanswered

Rename File Using Excel File

(0) ShareShare
ReportReport
Posted on by 4

I start off by using power query to get all the names of files within the folder. Then I use power query to add a column with how I want the file to be named (ie. "01.01.01 Name.pdf"  > "Name.pdf"). Now using the two columns in Excel I'm trying to rename the file that match within the column and rename them to the new name in the second column. Please see my attachment - any help would be greatly appreciated. 

 

 

Screenshot 2022-12-12 121242.png
Screenshot 2022-12-12 120640.png
I have the same question (0)
  • frasercotton Profile Picture
    4 on at

    Anyone?

     

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @frasercotton ,

     

    Do you want to rename files that match column1 to the new name in column2?

     

    Based on your description, I have made a simple test for your reference.

    vjefferni_0-1670832402404.png

    vjefferni_1-1670832402407.png

     

    Here is the flow:

    vjefferni_2-1670832402409.png

    vjefferni_3-1670832402411.png

     

    Result:

    vjefferni_4-1670832402412.png

     

    Best regards,

  • frasercotton Profile Picture
    4 on at

    @v-jefferni it needs to work within subfolders as well? Any ideas

     

  • VJR Profile Picture
    7,635 on at

    Hi @frasercotton ,this is a Desktop Flows forum and solution shared above is of Cloud Flows. Which one are you looking for?

  • VJR Profile Picture
    7,635 on at

    Ok, I saw your second screenshot and it contains Desktop Flows.

     

    So here it is...

    Since you have to rename multiple files with different names you cannot pass the entire %Files% datatable at once. Pass one file at a time.

     

    In line #6, use as below. Take care about the file extensions if it is needed.

    You can also have the folder path "C:\Test\" inside another variable like %FolderPath%%OldName%

     

    VJR_0-1671704651402.png

     

     

    Post back how its going.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    If you have the full path in A1 and the full new path in B1, put this formula in C1:

     

    ="ren "&""&A1&""""""&B1&""""

     

    copy it down

     

    now copy c1 to c whatever and paste it to command line.  If using PAD:

     

    Get Clipboard contents

    Open CMD Session

    Write to CMD Session using %ClipboardContents%

     

    This will work much faster than doing 1 at a time using PAD.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard