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 / Get file content, and ...
Power Automate
Suggested Answer

Get file content, and add attachment issue

(1) ShareShare
ReportReport
Posted on by 4
HI
Why does my flow keep returning these attachments with numbers,  the correct one is at the bottom and it works and opens, but i also get these attachments highlighted and i dont want them, i cannot open them as well 
 
 
 
Categories:
Screenshot 2025-0...

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at
     
    It looks like you attachment is blocked. Are you using the When a new email arrives (v3) action?
     
    If that is the case you could for example filter on Attachments Name. You can check if it contains a keyword or you can even check if the file ends with an certain extension to only use the attachments you want to process.
     
    Below is an example which checks if the file ends with .docx in a Filter Array action, if that helps?




     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel
  • Suggested answer
    Riyaz_riz11 Profile Picture
    3,891 Super User 2025 Season 2 on at
    Hi,
     
    Option 1: Filter Out the Bad Attachments
    Add a condition to check file size or name:
    Condition:
    length(items('Apply_to_each')?['contentBytes']) greater than 1000
    This filters out tiny/empty attachments that are usually the problematic ones.
     

    Option 2: Check File Extension
    Add another condition:
    Condition:
    contains(items('Apply_to_each')?['name'], '.pdf')
    (or whatever file type you expect)
     

    Option 3: Add File Size Check
    Sometimes those numbered attachments are 0 bytes:
    Condition: div(length(base64ToBinary(items('Apply_to_each')?['contentBytes'])), 1024) greater than 5
    This only processes files larger than 5KB.
     

    Option 4: Fix at the Source
    In your "Get Attachment" action:
    Make sure you're using the correct trigger
    Check if "Include Inline Attachments" is causing issues (turn it off)
    Try using "Get Attachments (V2)" instead of the regular version
     
     
    My Go-To Debug Method:
    Add a "Compose" action inside your attachment loop:
    Compose: 
    {
      "name": @{items('Apply_to_each')?['name']},
      "size": @{length(items('Apply_to_each')?['contentBytes'])},
      "type": @{items('Apply_to_each')?['contentType']}
    }
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
  • SZ-25091640-0 Profile Picture
    4 on at
    HI
     
    I have my setup like this, using switches,  see attachments
     
    then for the flow depending on each switch, i need a certain excel document attached to new items added to my sharepoint list, am i using the correct power automate steps.  please help i am new at this. 
     
    What my goal is:  Every time a new item is added to my list in Sharepoint depending on certain columns i need a certain excel template automatically attached to that line item.  I need the excel document to show as an attachment on the line item and the user to be able to click on it and open it when needed. 
    setup.png
    flow steps.png

    Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

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