web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

How to Handle Different File Extensions in a Loop When Renaming Files?

(0) ShareShare
ReportReport
Posted on by 26

I encountered an issue by renaming files within a loop, I inadvertently removed their extensions. This became problematic as the loop iterates through various file types such as PDFs or Excel files. Could someone please advise on how to extract the file extension during the loop for each specific file, and then ensure it’s added back to the filename when renaming? I tried adding a split function within the renaming of the file name, but it came with an error. Any help or guidance would be appreciated. Thank you!

 

jgoldstein3_0-1710945074501.pngjgoldstein3_1-1710945083561.png

 

 

I have the same question (0)
  • Verified answer
    creativeopinion Profile Picture
    10,480 Super User 2025 Season 2 on at
    Re: How to Handle Different File Extensions in a Loop When Renaming Files?

    @jgoldstein3  You can refer to this section of my latest YT Tutorial where I show you how to create a dynamic file name. At this point I show you how to extract the file extension. You can apply this concept to your flow. 

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard