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 / Change file extension ...
Power Automate
Unanswered

Change file extension in Power Automate

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

I have to change the File Extension in the Power Automate flow, For example, if the User is uploading a file with a .doc extension then it should change into a .docx extension with the file content presented inside the file. Finally, upload it into the SharePoint Documents. Also, I shouldn't generate the Prebuild templates, because by default it is generated in .docx format. Similarly, if the user uploads a file with .ppt it should change to .pptx and for .xls to .xlsx  Is there any way to achieve it?


Appreciate your suggestion. 

Any ideas?

 

Thanks.

Categories:
I have the same question (1)
  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi  @Anonymous , 

    We made a sample for you.

    slice(triggerOutputs()?['body/{FilenameWithExtension}'],lastIndexOf(triggerOutputs()?['body/{FilenameWithExtension}'],'.'),length(triggerOutputs()?['body/{FilenameWithExtension}']))

    vhanytianmsft_2-1692169395832.png

    concat(triggerOutputs()?['body/{FilenameWithExtension}'],'x')

    vhanytianmsft_3-1692169414067.png

     

    Hope this will help you,

    Best Regards,
    Tina

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Tina,

    Thanks for your help. The file is Generating as expected. But it is not reading file content values. When I try to open the file it is not opening. I have attached screenshots for your reference. Please help me out.

    Thanks

    4rose

    2023-08-16 14_51_45-Window.png
    2023-08-16 14_52_05-Window.png
    2023-08-16 14_51_56-Window.png
  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    After Testing of mine, it is worked.

    Therefore, could you please offer some screenshots about your Flow?

    We can solve it together.

     

    Best Regards,

    Tina

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Tina,

    Yeah Sure, Here I have attached my complete flow. Please check it.

    Thanks

    4rose

     

    Change File Extension Flow.png
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Tina,
    Here I have shared my complete flow in a zip format, Mine is not working as expected. Please check and help me to solve it.
    Thanks,

    4rose

  • SamLed Profile Picture
    2,340 Moderator on at

    Hi,

    This method can't work. Every old office formats (doc, xls, ppt) are binary content file formats while new ones (docx, xlsx, pptx) are XML content file format. What you are doing is a file copy to a file with a different extension but you need conversion. As far as I know, there is no standard action to do such conversion, have a look to premium ones from "Plumsail" or "Encodian".

    ______________________________________________________________

    If I have answered your question, please Accept the post as solution.
    If you like my response, please Thumbs Up.

  • e.evseychik Profile Picture
    42 on at
    A small addition to SamLed's reply. Plumsail Documents is not a premium connector but a third-party tool with separate pricing. You can use it with any plan in Power Automate if your Plumsail account has a paid plan. Also, after registering, you will have a free 30-day trial without providing any payment information so you can test it first and decide whether and how effectively it solves the issue.
     
    As regards the problem itself, this article describes how to convert files in bulk to the modern Office formats. Basing on it, I suggest the following flow:
    1. Trigger the flow on file creation in a SharePoint library.
    2. Add a switch control. Its input is an expression that splits the file name with extension by period and takes the last part. Cases are possible old formats.
      last(split(triggerOutputs()?['body/{FilenameWithExtension}'], '.'))
    3. In each case, get the file content using the trigger output, convert it to DOCX, and save the converted file.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard