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 : Rw2X3AbzgnzG64ZOWlxcMd
Power Automate - General Discussion
Unanswered

Change file extension in Power Automate

Like (0) ShareShare
ReportReport
Posted on 16 Aug 2023 06:26:08 by

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.

  • e.evseychik Profile Picture
    42 on 23 Dec 2024 at 08:17:39
    Change file extension in Power Automate
    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.
  • SamLed Profile Picture
    2,332 Moderator on 17 Aug 2023 at 07:57:03
    Re: Change file extension in Power Automate

    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.

  • Community Power Platform Member Profile Picture
    on 17 Aug 2023 at 07:06:28
    Re: Change file extension in Power Automate

    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

  • Community Power Platform Member Profile Picture
    on 16 Aug 2023 at 10:14:16
    Re: Change file extension in Power Automate

    Hi Tina,

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

    Thanks

    4rose

     

  • v-hanytian-msft Profile Picture
    Microsoft Employee on 16 Aug 2023 at 09:28:20
    Re: Change file extension in Power Automate

    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
    on 16 Aug 2023 at 09:24:07
    Re: Change file extension in Power Automate

    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

  • v-hanytian-msft Profile Picture
    Microsoft Employee on 16 Aug 2023 at 07:01:30
    Re: Change file extension in Power Automate

    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

     

     

     

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2