
Announcements
Apologies in advance as I'm new to Powerautomate.
I'm trying to filter out .png email signatures when grabbing email attachments and uploading them to OneDrive. I am able to successfully grab all attachments and download OneDrive. However, I can't get the condition filter to work on excluding .png signatures and I've tried countless solutions provided in other threads. Please see the whole flow below:
The flow completes and correctly iterates to true on .txt files and false on .png files as shown in the flow log:
True for .txt:
False for .png:
I am still receiving all .txt and all .png attachments in the provided folder path. I've tried using "Attachment Name", "Attachment Content" and all variations of conditions (contains, does not contain, ends with, does not end with, etc) and all variations of values (txt, png, image, image00, etc) and an IndexOf function with no success. This should work looking at the flow log and other solutions. Any help is appreciated.
Hi @rrpglad,
I would use the contentType property of the attachment. You can check if that does not equal to image/png.
Below is an example.
This setup is slightly different to yours. I first filter the list of attachments via a Filter Array action instead of using a condition within the apply to each loop.
With this approach you will only loop through the (filtered) ones you need. That means less loop runs 😛
In the filter array I am using an expression:
item()['contentType']