cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nash_Chang
Frequent Visitor

Condition to filter out email signature images

Hi Everyone,

 

Apologize in advance as I'm new to Power Automate. 

 

Trying to: Get email, create task, upload attachments to SharePoint, create links, update task detail with attachment. 

Issue: Email signature images come through as attachment. I tried using condition to filter it out as their names are consistent for everyone in the company.

 

But somehow it just doesn't filter. Here's the screen shots. Thank you for taking a look at this. 

 

Nash_Chang_0-1605551892270.png

Nash_Chang_1-1605551941482.png

Nash_Chang_3-1605552009241.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Nash_Chang I tried this on my inbox and seem to work with filtering attachments that do not have "image00" in the filename.

condition.png

View solution in original post

10 REPLIES 10
abm
Super User
Super User

Hi @Nash_Chang 

 

Could you post a screenshot of your run history to show the attachment names? The IF conditions are case sensitive.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
Paulie78
Super User
Super User

Problem is, because your condition is an or it is going to match with pretty much everything, even the other conditions. That condition will evaluate to true if any match.

 

Example image001.png would still get through because although your very first condition would filter it, your second one would allow it. I don't know if I am being totally clear, but hopefully you understand.

So short answer is change your "Or" at the top to an "And".

 

Alternative....better to filter the attachment array before the loop to get rid of all the attachments ending in .png. Faster and simpler.

Yeah here's the screenshot of the last run, but also attaching the screenshot of the attachments. 

Nash_Chang_0-1605552676279.png

Nash_Chang_1-1605552732443.png

 

Getting rid of attachments ending in .png was the original option, but now we start to have .png coming from the art department...

My initial attempt was to just do one condition if it doesn't start with "image00" but somehow that run would always fail. 

Paulie78
Super User
Super User

so just change the or to an and and it should be right, still feels like there should be a better way to do it.

@Nash_Chang I tried this on my inbox and seem to work with filtering attachments that do not have "image00" in the filename.

condition.png

Paulie78
Super User
Super User

@krootz I like that, well done. Would also work nicely in a filter to remove them before entering the loop.

Nash_Chang
Frequent Visitor

That looks beautiful and simple, but this is the message when I tried to save...not sure what I did.

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'Each_Attachment' referenced by 'inputs' in action 'Condition' are not defined in the template.'.'.

'Each Attachment' is the name I gave my Apply to each loop. You'll have to replace this with whatever name you gave your loop or if you didn't rename,  it will be 'Apply_to_each' or 'Apply_to_each_2', etc. 

 

loop name.png

Got it working, thank you so much! 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,297)