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 / Save file attachment t...
Power Automate
Unanswered

Save file attachment to Sharepoint Library causing file format not matching extension error

(1) ShareShare
ReportReport
Posted on by 27

Hi,

 

I'm sure I am missing something simple. I have set up an automation that identifies a regular email that I receive with data in an xlsx format file. This then saves the attachment to the correct folder I have set up. However, when I try to open this file it produces the following error:

"This workbook couldn't be opened because the file format may not be matching with the file extension."

 

This also means that other sheets that feed from this file are not being updated.

 

My flow is 

RhysWilliams_0-1715605212187.png

when a new mail arrives with "XYZ" in the subject, for each attachment, create file in "123" library with file name 

"name": "@item()?['name']",
"body": "@item()?['contentBytes']"
 
I've tried different "content" related options for content but none seem to be able to resolve the issue. 
Categories:
I have the same question (0)
  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @RhysWilliams 

     

    Firstly, switch to classic designer by toggle off 'New designer' on the top right corner:

    ManishSolanki_1-1715606476245.png

     

    Next, in the loop before "Create file" action add "Get attachment" action to get the content of the email attachment. Pass the message ID & attachment id as shown below:

    ManishSolanki_0-1715606171459.png

     

    Finally, add create file action to save a file in SharePoint. Pass the attachment name & content dynamically as shown below:

    ManishSolanki_2-1715606585290.png

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • RhysWilliams Profile Picture
    27 on at

    You beauty! Couldn't find any reference of the get attachment step in any posts I was following but it now works perfectly.

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard