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 / Power Automate creatin...
Power Automate
Suggested Answer

Power Automate creating corrupt xlsx files

(1) ShareShare
ReportReport
Posted on by 6
Hi all
 
I have a flow that gets a .xlsx from a form, before checking if a specified file exists in sharepoint. If the file doesnt exist, it creates it, otherwise it updates the existing file. Finally, it emails the same file to a specified address.
 
Techically, the flow works and completes fine. However, the .xlsx files that it creates are corrupt, and open with the error: "Excel cannot open the file xxx.xlsx because the file format or extension is not valid. Very that the file has not been corrupted and that the file extension matches the format of the file.
 
The form data comes in as a .xlsx via a HTTP request to sharepoint, and isnt changed through the flow. I have so far re-created the create and update nodes , turned off chunking, checked and re-checked the file extension etc,. Any ideas?
 
The part of the flow in question is currently:
Open to all suggestions. Cheers
Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
     
    Well i feel that using update file action is not needed instead , you should have tried excel actions in power automate where it adds row to excel table if exists.
     
    could you share about form source - what format it is retrived from http request from sharepoint ? That would be helpful :)
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!
  • KM-31071426-0 Profile Picture
    6 on at
    The form data is just a .xlsx, retreived using the "send a HTTP request to sharepoint" to send a GET to https://forms.office.com/ with the URI being /formapi/DownloadExcelFile.ashx?formid=MyFormID.
     
    Essenaitlly, Im happy for the data in the xlsx on sharepoint to be overritten every time, as the only change will be the newest reponse to the form, which gets tacked on in a row undernearth any existing rows.
     
    I've had a look at the excel functions but cant get it to do exactly what I want, though im sure there is a way.
     
    I also get corrupt excel files using the "create file" and filling with the body of the HTTP request, which has worked for me before on OneDrive but is failing in Sharepoint.
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
     
    Sorry, i just have tried the api and used create file and update action- it is working fine and file is not getting corrupted.
     
    See below on how i created and updated the file FormResponses.xlsx
     
    This action checks whether the file with name FormResponses.xlsx exists or not ?
     
    Now use a condition action which validates whether the file exists or not using output from above action.
     
     
    Expression used for this --  length(outputs('Get_files_(properties_only)')?['body/value'])
     
     
    If the condition is true (Yes branch)
     
    if condition is false, then follow No branch
     
    Expression used - 
    first(outputs('Get_files_(properties_only)')?['body/value'])?['{Identifier}']
     
     
     
    This would work !
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     

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