web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate saves e...
Power Automate
Suggested Answer

Power Automate saves email attachments as 1 KB files (Outlook → SharePoint)

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

I created a Power Automate flow to automatically save email attachments from incoming emails.

 

The flow structure is:

  1. Trigger: “When a new email arrives (V3)”
  2. Automatically generated “Apply to each” loop for attachments
  3. (optionally tested) Action: “Get attachment (V2)”
  4. Action: “Create file” (SharePoint or OneDrive)

The goal is to save the attachments into a SharePoint document library.

 

Problem:

The flow runs successfully according to the test results, but the created files are only about 1 KB in size and cannot be opened.

The issue occurs with both:


  • OneDrive
  • and SharePoint

  •  

Additional details:


  • File names are correct
  • Multiple attachments are detected correctly (Apply to each works)
  • Attachments are e.g. PDF files
  • The issue also occurs with simple test emails

  •  

I tested the flow:

  • without “Get attachment (V2)” (using “Attachments Content” directly from the trigger)
  • and with “Get attachment (V2)”

  •  

In both cases, the result is the same (files ~1 KB).

In the “Create file” action, I tried using:


  • “Attachments Content” from the trigger
  • Fields from “Get attachment (V2)”

  •  

However, in the dynamic content panel of “Get attachment (V2)”, I cannot find a clear field for the actual file content (e.g. ContentBytes).

Questions:


  • Which field should be used for the file content in the “Create file” action?

  • Why is no usable file content returned from “Get attachment (V2)”?

  • Are there known issues with this setup?
Thank you in advance for your help!
Eingang neuer E-Mail.jpg
Datei erstellen.jpg
Categories:
I have the same question (0)
  • Suggested answer
    frago Profile Picture
    226 on at

    Root cause

    The files are ~1 KB because you’re not using the actual binary content of the attachment, only metadata (or an empty/incorrect field).

     

    Key point

    In Power Automate, the correct field is:


    • From “Get attachment (V2)”ContentBytes
     
    Correct Inside your Apply
    • Get attachment (V2)

      • Message Id → from trigger

      • Attachment Id → from trigger


      •  
    • Create file

      • File Name → Attachment Name

      • File Content → ContentBytes (from Get attachment) 

        ------------------------------------------------------------
    • If this solved your issue, please mark it as ✅ Accepted Answer.
      If it helped, feel free to give it a 🩷 Like!
       
      Best regards,
      Piotr
       
       
  • David_MA Profile Picture
    14,371 Super User 2026 Season 1 on at
    I find that you need to wrap the file content in a base64tobinary() expression. Note, this does not work if text or csv files are attached, but you said you are getting pdf files. 
    The expression for the file content is: 
     
    base64ToBinary(items('Apply_to_each')?['contentBytes'])

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard