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 Files based on ...
Power Automate
Answered

Rename Files based on Excel

(0) ShareShare
ReportReport
Posted on by 26

Hello everyone,

 

I am using Power Automate Desktop to try to rename files based on data from excel and here is my excel table.

NameExtensionDate accessedDate modifiedDate createdFolder PathFinal Name

Croco Child.jpg.jpg02-07-2022 17:38:3429-07-2015 20:31:2002-07-2022 17:38:34C:\Users\win\Desktop\Photos\Crocodile_29-07-2015 20:31:20
Midway Horse.jpg.jpg02-07-2022 17:38:3424-02-2014 01:35:5302-07-2022 17:38:34C:\Users\win\Desktop\Photos\Horse_24-02-2014 01:35:53

 

The first column(Name) is the current file name and the last column name (Final Name) is the name that I want to give to the files.

 

For some reason the flow is not taking the column names of the excel file and giving errors.

 

Screenshot (354).png

I the flow variable I am able to see the column names and yet the flow is not able to recognize the column names.

Screenshot (355).png

 

Please can someone help me out as I am trying to make the whole thing dynamic based on the data in excel, by creating 'For each' loops.

 

Thank you,

 

Vishesh Jain

Categories:
I have the same question (0)
  • jaredbidlow Profile Picture
    258 on at
  • visheshjain Profile Picture
    26 on at

    Hi @jaeiow,

     

    I am trying to do this on Power Automate Desktop and the solution you mentioned requires using the online flows.

     

    For reasons unknown PAD is not able to recognize columns from the excel even after the read excel function is giving me the desired table.

     

    Thank you,

     

    Vishesh Jain

  • visheshjain Profile Picture
    26 on at

    Hello,

     

    I've tried multiple methods and for some reason I am getting the following error:

    Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Can't rename file ---> System.NotSupportedException: The given path's format is not supported.
    at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
    at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
    at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
    at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.Execute(ActionContext context)
    --- End of inner exception stack trace ---
    at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.Execute(ActionContext context)
    at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

     

    It is unable to recogniize or get the file path but when I copy paste the same file path in the windows explorer, it opens up the file immediately.

     

    When I put a Display message action to display the output of the flow variable, it shows me the correct path.

     

    Please is someone can help me.

     

    Thank you,

     

    Vishesh Jain

  • AS-06081019-0 Profile Picture
    1,738 Super User 2024 Season 1 on at

    @visheshjain Please check your action 'Read from Excel Worksheet' if you have enabled below:

    Ankesh_49_0-1656928370015.png

    Ankesh_49_3-1656928624717.png

     

     

    Ankesh_49_2-1656928555977.png

     

    Ankesh_49_1-1656928532775.png

     

    Hope it helps!!

     

    Cheers,

    Ankesh

    --------------------------------

    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

     

  • visheshjain Profile Picture
    26 on at

    Hi @Ankesh_49,

     

    Yes I have enable the first rows as header.

     

    I tried the same thing and I am now getting the correct FilePath when I use the Display Message.

     

    However, when I try to use that same path in order to get the file to rename, I get an error.

     

    If you'd like any further information then please let me know.

     

    Thank you,

     

    Vishesh Jain

  • AS-06081019-0 Profile Picture
    1,738 Super User 2024 Season 1 on at

    What are the steps you are performing here in the highlighted part:

    Ankesh_49_0-1656937059910.png

    Would you mind sharing a screenshot?

  • visheshjain Profile Picture
    26 on at

    Hi @Ankesh_49,

     

    Thanks for taking the time to respond.

     

    Here are my steps.

     

    As you can see, the flow works fine and it displays the right message.

     

    It is only in step 7 when I actually try to rename the files it gives an error.

     

    Hope this helps you understand the problem better.

     

    Screenshot (357).png

     

    Thank you,

     

    Vishesh Jain

  • AS-06081019-0 Profile Picture
    1,738 Super User 2024 Season 1 on at

    Could you please share Rename file action screenshot. I believe its something to do with date time format in the filename or the path

  • visheshjain Profile Picture
    26 on at

    Here is the Rename Files step and as you can see in the 2nd screenshot I am getting the message in the display.

     

    The new names have been defined in the excel sheet itself and have been converted to the format text.

     

    Screenshot (358).pngScreenshot (359).png

    Screenshot (360).png

     

    Thank you,

     

    Vishesh Jain

  • Verified answer
    AS-06081019-0 Profile Picture
    1,738 Super User 2024 Season 1 on at

    @visheshjain 

    Issue here is with the file name refer below:

    https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file

     

    Ankesh_49_0-1656951146505.png

    Ankesh_49_2-1656951706194.png

     

    Therefore, either you change the filename or use replace text at runtime to remove ':'

    Ankesh_49_1-1656951328403.png

     

    Hope it helps!!

     

    Cheers,

    Ankesh

    --------------------------------

    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

     

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 378

#2
Valantis Profile Picture

Valantis 329

#3
David_MA Profile Picture

David_MA 283 Super User 2026 Season 1

Last 30 days Overall leaderboard