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 / SharePoint Create File...
Power Automate
Suggested Answer

SharePoint Create File action generates corrupt file

(0) ShareShare
ReportReport
Posted on by 18
A flow that gets the File content of an Office Template file (File Path parameter could point to .dotx, .xltx, .potx) and immediately uses Create file to output to a SharePoint Office document file (File Name parameter could point to .docx, .xlsx, .pptx) , creates a corrupt file.
 
Chunking is Off on the Create File Settings.
 
Error messages when opening files:
   - Word (.docx): Word was unable to read this document. It may be corrupt...
   - Excel (.xlsx): Excel cannot open the file... 
    
 
This sequence worked previously - have the SharePoint actions been changed to prevent this from working?
 
Makes one think that the 'codeless' catch-phrase should be changed to 'clueless' as in, 'I've configured Power Automate actions but I'm clueless as to why i got this result'.
Categories:
I have the same question (0)
  • Suggested answer
    tom_riha Profile Picture
    10,185 Most Valuable Professional on at
    Hello,
     
    you want to use the 'File content' dynamic content as the File Content, not the 'body' output.
  • PSCJohnM Profile Picture
    18 on at
    Hi @tom_riha​​​​​​​,
     
    Thanks for replying.
     
    One of the weirdities of codeless, I guess, but, in the original designer, when you select File Content:
     
    Body is shown when you re-open the flow: 
     
    In both cases, the underlying code is generated as "body""@body('Get_file_content_using_path')".
     
    New designer consistently shows File Content.  Which is misleading/wrong as the underlying attribute is Body...!
  • PSCJohnM Profile Picture
    18 on at
    Oh Man...
     
    So, I've accidentally discovered that the Word was unable to read the document error, only appears when you try to open the document in the Word client first:
     
    When you open the document in the Online viewer, a warning is shown that you are opening a template and asking if you want to open and edit as a standard document:
     
    If you click Yes, the document opens normally.
     
    The document can then be opened successfully from the Word client!
     
    This is not a solution, but a (quite poor actually) workaround.  
  • PSCJohnM Profile Picture
    18 on at
    Still no answers on this issue?  Is there any way to know if anyone has even seen this post?
     
    I would have thought a fairly basic requirement of Power Automate would be copying Office Templates to Documents.  I can't believe I have to use Premium connectors from 1 3rd party to do basic tasks... 

    The workaround I mentioned for Word documents doesn't work for Excel or Powerpoint.
  • PSCJohnM Profile Picture
    18 on at
    OK - I'm guessing no-one reads this forum.
     
    Just in case someone comes across this while tidying up:
    1. There's no way of telling whether anyone has seen this post
    2. There's no way of responding to a user's post
    3. There's no way of flagging another user's suggested answer as not the answer
      1. So, if someone flags their reply as a suggested answer, and never again reviews the replies, the Post will forever display as Suggested Answer

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard