Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Random .png file is being uploaded when i upload email attachment

(0) ShareShare
ReportReport
Posted on by 26

Firstly, kindly bare with me as I am a noobie and have recently started working on Power Automate.

 

I am trying to build a flow which involves uploading an email attachment received (from a shared mailbox) to a sharepoint folder . I want to ensure that only those attachments are uploaded that have 'sample' in their name. I am having trouble doing this.

 

In addition to that, I have noticed that my current flow is working well except for the fact that all attachments are being uploaded to the sharepoint folder along with a random .png file. I believe it has something to do with InLine attachments (maybe its the email signature). However, i am having trouble excluding this file from being uploaded to sharepoint.

 

I have attached screenshots of my flow for reference.

  • creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Random .png file is being uploaded when i upload email attachment

    If you are filtering out more than a single file type you will need to use an expression in the Filter Array action. 

    creativeopinion_1-1690769728549.png

     

    Single File Type

    For the Value, select Attachments Name. Select does not end with and type in the file extension.

    creativeopinion_2-1690769821658.png

     

    Multiple File Types

    Click on edit in advanced mode and enter an expression (below).

    Tip: Do not bother trying to type in the field. Compose your expression in a text editor and copy and paste. The advanced mode field is very buggy and it will move your cursor as soon as you start to type. 

     

    In my example below I'm filtering out all .png and .jpg file types. You can add more lines if you'd like. Please note that the last condition line does not have a comma. 

    @And(
     not(endsWith(tolower(item()?['name']), '.png')),
     not(endsWith(tolower(item()?['name']), '.jpg'))
    )

     

    Hope this helps.

     

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

  • zain28 Profile Picture
    26 on at
    Re: Random .png file is being uploaded when i upload email attachment

    Ideally by type

  • creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Random .png file is being uploaded when i upload email attachment

    What do you want to filter by? The type or size? 

  • zain28 Profile Picture
    26 on at
    Re: Random .png file is being uploaded when i upload email attachment

    Hey, thanks for your response, could you let me know what the flow would be to filter out the attachment (using type or size). I am still learning power automate so I would appreciate some guidance.

  • creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Random .png file is being uploaded when i upload email attachment

    Could you try to filter out attachments that are a specific file size? I'd imagine those images are very small in size. If possible, you can filter out by attachment type. 

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1