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 / Someone who knows how ...
Power Automate
Answered

Someone who knows how to fix this? Renaming a just created file.

(0) ShareShare
ReportReport
Posted on by 77

Hello, 

 

Anyone know why this doesn't work and how I could fix it?

I want to rename a file I just created in the flow and then open it with excel. Even if I do it without rename it gives error messages when I want to open it in excel. So both renaming and opening the excel fails. Someone who knows how to fix this?

 

Martijn2_0-1707382129735.png

 

 

Thanks in advance, 

 

 

 

I have the same question (0)
  • Verified answer
    eetuRobo Profile Picture
    4,579 Super User 2026 Season 2 on at

    Your %CopiedFiles2% is list of files(an array).
    You should loop through them. Or if you want only the first file use %CopiedFiles2[0]%. 

  • Martijn2 Profile Picture
    77 on at

    Very good huge thanks, this works.

  • Verified answer
    UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Hi @Martijn2 

    The variable copiedfiles contains list of files so you need to get single file one by one either by loop through it by for each or by calling using index as Copiedfiles[0]

    and Rename file as shown in below image

    UshaJyothi20_0-1707383514076.png

     

    Hope this helps,

    Usha.

  • Martijn2 Profile Picture
    77 on at

    Hi Usha,   I get the following error message. Do you know what is going wrong here?

     

      { "error": { "code": "File.RenameFileError", "message": "Probleem bij uitvoering van actie Rename. Kan bestandsnaam niet wijzigen \r\n \r\nMicrosoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Kan bestandsnaam niet wijzigen ---> System.NotSupportedException: De opgegeven padindeling wordt niet ondersteund.\r\n bij System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)\r\n bij System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)\r\n bij System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)\r\n bij Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.Execute(ActionContext context)\r\n --- Einde van intern uitzonderingsstackpad ---\r\n bij Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.Execute(ActionContext context)\r\n bij Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)\r\n" } }  

     

    Martijn2_1-1707387201703.png

     

    Thank you in advance, 

  • eetuRobo Profile Picture
    4,579 Super User 2026 Season 2 on at

    The CopiedFiles has the whole file path in it. Now you have the file path double.

    eetuRobo_1-1707389424588.png

     

    So just put the %CopiedFiles2[0]% to the "File to rename" field.

  • Martijn2 Profile Picture
    77 on at

    Still got the following problem, It says it cannot edit the file.  Is the cause possibly from the variable then, if I just output it without cloudflow behind it, it works. 

     

    { "error": { "code": "File.RenameFileError", "message": "Probleem bij uitvoering van actie Rename. Kan bestandsnaam niet wijzigen \r\n \r\nMicrosoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Kan bestandsnaam niet wijzigen ---> System.NotSupportedException: De opgegeven padindeling wordt niet ondersteund.\r\n bij System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)\r\n bij System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)\r\n bij System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)\r\n bij Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.Execute(ActionContext context)\r\n --- Einde van intern uitzonderingsstackpad ---\r\n bij Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.Execute(ActionContext context)\r\n bij Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)\r\n" } }

     

    Martijn2_1-1707408243401.png

     

    I have already done almost all possible combinations today with _ or other tests in terms of with or without extension.

     

    Anyone else have a good suggestion?

     

    Thank you in advance

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 271 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 171 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 148 Super User 2026 Season 2

Last 30 days Overall leaderboard