Skip to main content

Notifications

Community site session details

Community site session details

Session Id : M1X3eVZ5xZOzQNy1OdE1rI
Power Automate - Building Flows
Answered

Create File -- File has no extension, adding .docx results in message file is corrupt

Like (0) ShareShare
ReportReport
Posted on 22 Feb 2019 18:32:26 by 20

I have successfully created a flow that creates a file when a request is approved. 

 

The problem is that the created file has no extension. It can be opened with Word, but the user has to select that application every time. I would like for the document to either open in Word or Acrobat every time without the user having to select an app to open it.

 

When I add .docx to the file name in the Create File action, the user gets a message that the file is corrupt and that Word cannot open it.

 

Thanks very much for your help on this!

  • Ak4tsuk1 Profile Picture
    2 on 21 Apr 2023 at 16:43:19
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    Hi,

    You could use an expression with the concat function.

    such as
    concat(triggerOutputs()?['body/subject'],'.docx')
    For the triggeroutput, choose your file name (my expression is when you want to rename a file from the subject of an email so you have to adapt it)
    And use this expression as your File Name on the Create File step
     
    I've done it for a pdf file, and it worked.
     
    Hope it'll help...
  • Hitay Profile Picture
    30 on 18 Aug 2020 at 15:02:04
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    Hi @kreed 

    could you find a solution to this Problem?

    Would be really thankfull for a quick answer. 

     

    Best,

    Hilal

  • kreed Profile Picture
    20 on 26 Feb 2019 at 23:58:16
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    That must be the issue. I don't have a premium plan and the company that I work for probably won't want to invest in one. Do you know if there is a workaround or another way?

  • Verified answer
    iivanov Profile Picture
    on 26 Feb 2019 at 23:41:21
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    I don't believe the File Content field within Create a File can be used to pipe in values like you have it set up. In my setup, I fill in a Word template, then use that. Is this a possibility in your use case?

  • kreed Profile Picture
    20 on 26 Feb 2019 at 23:25:20
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    When I add the extension as below, I get a new file in the OneDrive folder which looks good, but when I click on it, I get the error you see in the last two screenshots. I'm really scratching my head here--seems like I'm missing something really simple.

     

    extension.png

    list of files.png

    word_error.png

    corrupt.png

  • iivanov Profile Picture
    on 26 Feb 2019 at 22:47:34
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    Seems like the issue is that you haven't included your file extension in the file name on the Create File action (easy miss!). Here's how one of my Flows looks, which generates a Word and PDF document:

     

    Capture1.PNG

  • kreed Profile Picture
    20 on 26 Feb 2019 at 20:43:41
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    Apologies--my scrolling capture is not working at the moment! Thanks very much for  your help!

     

    1.png2.png3.png4.png5.png

  • iivanov Profile Picture
    on 26 Feb 2019 at 19:25:39
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    @kreed could you post a screenshot of your flow?

  • kreed Profile Picture
    20 on 26 Feb 2019 at 19:17:28
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    Actually, a PDF would be preferable, but I tried this and cannot open the PDF either. 

  • kreed Profile Picture
    20 on 22 Feb 2019 at 18:39:26
    Re: Create File -- File has no extension, adding .docx results in message file is corrupt

    Thank  you--I will try it out!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started