Skip to main content

Notifications

Power Automate - Power Automate Desktop
Answered

Renaming Files

(1) ShareShare
ReportReport
Posted on by 6

Greetings,

I have a folder with the following file that gets dropped using FTP. The file must be renamed after once it is available in the specified folder. 

  • Downloaded Naming Convention: CompanyName_ReportName_VendorName_2024_07_17_v1.0.xlsx
  • Desired Naming Convention: CompanyName_ReportName_VendorName.xlsx
I tried using Replace() expression but it require that I hardcode the file name. However the last part of the file name changes every week.
Regards
Categories:
  • Suggested answer
    Nived_Nambiar Profile Picture
    Nived_Nambiar 17,110 on at
    Renaming Files
    Hi,
     
    Assuming the file format is always same -
     
    you can try this-
     
     
    Expression used- 
    concat(join(take(split(outputs('Compose'),'_'),3),'_'),'.',last(split(outputs('Compose'),'.')))
     
    Now see the result
     
     
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
     
  • HD-02081403-0 Profile Picture
    HD-02081403-0 6 on at
    Renaming Files
    Thank you. I am using Power Automate online version. I think you are using the desktop version. I really appreciate your help and details.
  • Suggested answer
    Renaming Files
    You can set the namein rename file action, so u can remove the date component from the file name using replace text action and set the resultant name in rename file (s) action. see below
    1. Assume this is input file name

       
    2. Use Replace text action so to replace date component_version with empty string as shown below

      Now Replaced variable stores the output- i,e replaced file name with no dates or versions
       
    3. Now use rename file to set new file name as shown below

       
    4. See hoe replaced variable value looks like which has the file name of resultant

       
    Hope it helps !
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard