Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

SharePoint Create File action generates corrupt file

Posted on 11 Nov 2024 22:07:43 by 16
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'.
  • PSCJohnM Profile Picture
    PSCJohnM 16 on 22 Nov 2024 at 13:06:01
    SharePoint Create File action generates corrupt file
    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
    PSCJohnM 16 on 14 Nov 2024 at 12:15:36
    SharePoint Create File action generates corrupt file
    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
    PSCJohnM 16 on 13 Nov 2024 at 09:00:01
    SharePoint Create File action generates corrupt file
    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...!
  • Suggested answer
    tom_riha Profile Picture
    tom_riha 9,930 on 12 Nov 2024 at 21:07:28
    SharePoint Create File action generates corrupt file
    Hello,
     
    you want to use the 'File content' dynamic content as the File Content, not the 'body' output.

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

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,111

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,795

Leaderboard