Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

"Populate a Microsoft Word Template" generating a .docx file with undreadable content

(0) ShareShare
ReportReport
Posted on by 21

I have a flow which takes answers from a Microsoft Form and uses them to populate a template. The template is saved as a .docx. The flow runs successfully but sends a word document as an attachment that produces the following error:

 

amcneil15_0-1715884654164.png

 

If I click yes, I get this:

amcneil15_1-1715884682587.png

 

Here is my Flow:

 

amcneil15_2-1715884728457.png

amcneil15_4-1715884827935.png

 

amcneil15_3-1715884796335.png

 

 

  • Verified answer
    AM-19081617-0 Profile Picture
    21 on at
    Re: "Populate a Microsoft Word Template" generating a .docx file with undreadable content

    For this to finally work. I had to add a variable control that I named "attachments array" with this schema:

    {
    "Name": (Pass File Name Here)
    "ContentBytes": (Pass file contents here)
    }

     

    Then passed that array in the attachments section of the email control.

  • AM-19081617-0 Profile Picture
    21 on at
    Re: "Populate a Microsoft Word Template" generating a .docx file with undreadable content

    Update: I can create and save a new file from the file content of the 'Populate a Microsoft Word Template" action. However, when I add that file content to the attachments section of the 'send an email' action, the file will not open.

  • AM-19081617-0 Profile Picture
    21 on at
    Re: "Populate a Microsoft Word Template" generating a .docx file with undreadable content

    Thanks for the reply. I tried both of these solutions with no luck. In fact, I added a create file to a sharepoint site action and it creates the file and saves it perfectly, and I can open it from the sharepoint site. However, the when I add that file content to an email attachment action, it will not open from the email.

  • Ntulikid Profile Picture
    29 on at
    Re: "Populate a Microsoft Word Template" generating a .docx file with undreadable content

    Hi 

     

    Try to switch Power Automate to classic mode, this is achieved by toggling the switch on the top right, on the right side of new designer see if it will work.

     

    If it doesn't work, add a create file connector after populate word template, then use get file content using path and then use the file content dynamic control from the get file content using path connector on the attachment content

  • AlexEncodian Profile Picture
    4,409 Super User 2025 Season 1 on at
    Re: "Populate a Microsoft Word Template" generating a .docx file with undreadable content

    @amcneil15 

     

    Try adding a file extension to the name field in attachments form of send email action.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1