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 / Change Filename to Tit...
Power Automate
Unanswered

Change Filename to Title Case Desktop in middle of a Flow

(1) ShareShare
ReportReport
Posted on by 73
Hi Experts
 
This in continuation to the thread - 
 
 
where @eetuRobo provided me with the required answer
 
Now a new situation came up.
 
I tried to use his method - 
  • When I do exactly as advised, it works fine.
  • But at times I need to use it in the middle of a flow (screenshot attached). At that time it gives error - Unable to rename file.
Please help
 
Thanks a lot 🙏
 
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    Hello!

    Problem is that Rename files -action creates a list of files.

    And when your second Rename file(s) -action tries to rename the file it gets a list value when it should get string of the file path. So you need to refer to the %R000% -variable as %R000[0]% to get the first list item (in your case there will always be just one list item since it takes just one per loop).

    Also since your Current item is File-type variable with different properties you want to use "NameWithoutExtension" or in the second Rename file(s) action toggle off "Keep exension" (otherwise it will rename the file "Test Name.Txt.txt")


    Try like so:




    Hope this helps!
  • SanjayGMusafir Profile Picture
    73 on at
    @eetuRobo Thanks for helping.
     
    My challenge is that I'm unable to understand how to add properties to these. If I type manually, it gives error.
     
    Please advise.
     
    Thanks a lot 🙏
     
     
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    Happy to help!

    ​​​​​​​Like so:
    %R000[0].NameWithoutExtension%

    Since the R000 is a list you need to tell it which item you are referring to. So in your case the R000 list will always have just one item so you reference the first item which is index zero %R000[0]%. Then add dot and the property "NameWithoutExtension".

    Sometimes PAD also knows to give them to you in the variable selection when you expand the CurrentItem



    You could also do the flow like this. I tried to explain in red text what the actions do:


    Copy the actions to your flow:
    Display.SelectFileDialog.SelectFiles Title: $'''Choose Files''' InitialDirectory: $'''C:\\Users\\x''' IsTopMost: False CheckIfFileExists: False SelectedFiles=> SelectedFiles ButtonPressed=> OpenFiles
    File.RenameFiles.RenameReplaceText Files: SelectedFiles TextToReplace: $'''_''' ReplaceWith: $'''%' '%''' IfFileExists: File.IfExists.DoNothing RenamedFiles=> R000
    SET oNames TO R000
    IF OpenFiles = $'''Open''' THEN
        LOOP FOREACH CurrentItem IN oNames
            Text.ChangeCase Text: CurrentItem.NameWithoutExtension NewCase: Text.CaseOption.TitleCase Result=> nName
            File.RenameFiles.Rename Files: CurrentItem.FullName NewName: nName KeepExtension: True IfFileExists: File.IfExists.DoNothing RenamedFiles=> R002
        END
    END
     
  • SanjayGMusafir Profile Picture
    73 on at
    @eetuRobo Thanks a lot 🙏
     
    That did the magic

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard