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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create a file with a w...
Power Automate
Answered

Create a file with a word template

(1) ShareShare
ReportReport
Posted on by

Hi all, 

I would like to create a flow : when an item is created in a list, create a file in a Sharepoint Library with the items from the list. The file is actually a word template document (a custom content type). The problem is that the word document say error when I want to open it. 

Could you help me ? Do you have another solution ?  

flow1.PNGflow2.PNG

 

Thank you, 

Martin

Categories:
I have the same question (0)
  • PieterVeenstra Profile Picture
    on at

    It is easier to create a document by getting the content using a Get file content action.

    GetFileContent.png

    This now gives you Word (or whatever format the tmeplate file is that is referenced in the identfier) formatted file content.

     

    Then using the Create File action you can create a fiel wherever you like.

  • Community Power Platform Member Profile Picture
    on at

    Thanks for your help. 
    Unfortunately, the Word error is the same

    flow3.PNG

  • PieterVeenstra Profile Picture
    13 on at

    Hi Martin,

     

    Are you able to open the document that you are using as a source within Office Online without the error message appearing?

  • Community Power Platform Member Profile Picture
    on at

    Yes, and when I create a new document in the library it opens correctly. If I fill in the item properties manually the Word Document accepts the fields.

    I modified the File identifier (I don't really know what I'm doing but I try to find a solution). If I chose my template document for the file identifier, it opens correctly in the library but the list fiels aren't copied.

     

    flow4.PNGflow5.PNG

  • PieterVeenstra Profile Picture
    on at

    You document lives in the Forms/Content type folder. 

     

    Can you try moving your template document into the document library itself and then copy it from there.

  • Community Power Platform Member Profile Picture
    on at

    I added a "Update File Properties" action and the fields from the list are now copied.

     

    I moved the template into the document library itself : the document created is a copy of the template but doesn't take the item fields in consideration. Even if I do it manually.

  • PieterVeenstra Profile Picture
    13 on at

    Hi @Anonymous,

     

    That sounds like a content type issue to me. 

     

    Does the ocntent type where you copy the document from match the content type where you copy it to? Are the fields identical in both librasries ( i.e. are you using site collection columns?)

  • Community Power Platform Member Profile Picture
    on at

    Thanks for your answers.

    I finally did it thanks to SharePoint Designer.
    I followed this article : https://sharepointlibrarian.com/2016/09/30/sp-workflow-to-create-a-document/

     

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Within the "Create file" action within your flow, the File Content field is required to fill an binary data, but you filled a String within it.

     

    More details about the "Create file" action of SharePoint list, please check the following article:

    Create file action

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a "When an item is created" trigger, specify Site Address and List Name.
    • Add a "Compose" action, Inputs set to following json data:17.JPG

       

    • Add a "Create HTML table" action, From set to following formula:

      array(outputs('Compose'))
    • Add a "Create file" action, File Content field set to output of "Create HTML table" action, File Name field set to following formula:

      First Name Dynamic content Last Name Dynamic content .doc

       

    Note: File Name ends with .doc rather than .docx within File Name field of "Create file" action.

     

    Image reference:18.JPG

    The flow works successfully as below:19.JPG

    The created file opened successfully in my SharePoint library as below:20.JPG

     

     

     

    Best regards,

    Kris

     

     

     

     

  • Community Power Platform Member Profile Picture
    on at

    Thank you !! It works

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard