Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Flow to create Word document from PowerApp

(0) ShareShare
ReportReport
Posted on by 31

I have created an app that connects to a SharePoint list and the app is working ok.  We now have a requirment where someone can open an item in the app and then press a button, which will output the fields from that item into a Word document.

 

The image below shows how I've tried to do this so far.  I have created a flow to add the fields in the item into an Excel spreadsheet, which works.  The next stage is then trying to create a Word document using information from the spreadsheet.  This Word document is created successfully but when I try to open it Word says the file is corrupt, and the reason for this is explained here.

 

My question is this - is it possible to create a file with blank file content?  I just need to create the file because I can then use another Flow to set the content of the file using field values from the SharePoint document library.

 

Thanks for your help in advance.

 

Capture.PNG

  • NPrice99 Profile Picture
    NPrice99 1,272 on at
    Re: Flow to create Word document from PowerApp

    Hio

     

    DO we really need a SHarePoint Designer (2010) workflow ?

     

    Can Flow not do this ?

     

    REgards

     

    Nigel

  • j3ffc0ll1ns Profile Picture
    j3ffc0ll1ns 2 on at
    Re: Flow to create Word document from PowerApp
    Create site columns for all the variables in your Word document
    Create a site content type derived from Document and associate the site columns with the content type
    Create a document library called "my templates"
    Change the document library to allow for managing content types
    Add the site content type to the document library
    Upload your word document to the library
    Open the word doc in word desktop and resave back to the library, you will be prompted for which content type, choose the new one you just made
    Close out of the old word doc and then delete it
    Open the new word document
    Insert into the word document the site columns in the appropriate locations in the document
    Save and exit
    Create another document library to contain your documents created by this process
    Add the site content type to this doc library
    Edit the advanced properties of the content type associated with this library to use the template document from the other library
    Create a SharePoint list
    Add the site columns to this list
    Create a SharePoint Designer (not Flow) 2010 (not 2013) workflow that is associated with this list
    The workflow is triggered by new or changes to the list
    The step inside the workflow create a new item in the Document library using the site content type and also inerts the list values into the site columns associated with the content type
    Publish the workflow
    Create a powerapp on the list
    Every new list item created by the powerapp will make a new word document
  • BenjaminDoyle Profile Picture
    BenjaminDoyle 14 on at
    Re: Flow to create Word document from PowerApp
    Also, new here, but stating simple solution isn't supported doesn't quite mean solved. We should shoot for actual solutions or leave as unresolved to invite creative workarounds.
  • BenjaminDoyle Profile Picture
    BenjaminDoyle 14 on at
    Re: Flow to create Word document from PowerApp
    Haven't done with excel, but I use a sharepoint list item selected trigger to request or get data frome onenote notebook :: section :: page. Onenote returns data as html. So if you do onenote get page. Then add action html to text, you can then add to field cell in Share point list. Or skip html to text and grab html. Try create file action sharepoint with body.docx. with proper html content framework.... html body statements....might work.
  • Re: Flow to create Word document from PowerApp

    Hi,

     

    I while ago I was also looking into document creation from Flow and came across this: https://plumsail.com/docs/actions/v1.x/flow/actions/document-processing.html#create-document-from-docx-template . Didn't try it, but looks promising Smiley Wink

  • Verified answer
    v-micsh-msft Profile Picture
    v-micsh-msft on at
    Re: Flow to create Word document from PowerApp

    Hi @gjayne84,

     

    Currently there is no Microsoft Word connector available in PowerApps or Microsoft Flow.

    Which means currently it is not possible to create a word file, but you could take use of the Copy file action to copy a word document from one place to another.

    If you would like Microsoft Flow to have the function of creating word type file, then please consider submit it as an idea, or vote the following one:

    Add to Flow: Microsoft Word Actons

     

    Regards,

    Michael

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard