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.
If you are filtering out more than a single file type you will need to use an expression in the Filter Array action.
Single File Type
For the Value, select Attachments Name. Select does not end with and type in the file extension.
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! |
Ideally by type
What do you want to filter by? The type or size?
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.
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! |
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1