Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Create Planner Task when new emails come in - Filter Emails

So I have created this flow that automatically creates a Planner task, including attachments, from emails sent to a specific mailbox, I followed this guide


I got everything working but now I'm trying to filter emails so that a task is not created if the email comes from a specific email address. My flow looks like this


I tried to add a condition after the "When a new email arrives" action but I got an error with my variable step saying that the variable can only be part of the main flow and not a condition. The I thought about using a filter array but didn't have much success with that because well, I'm not really familiar with how that works as far as putting the array function together. 


Any help would be greatly appreciated! Thank you

Dual Super User
Dual Super User

Hi @moraleseder,


You could use a trigger condition for this and check the value of the from field.


Below is an example of that approach.


Add the following expression to the settings of your when an new email arrives trigger action.

Replace the value by the e-mail address you want to exclude.



@not(equals(triggerOutputs()?['body/from'], ''))




Can I add multiple emails?

Dual Super User
Dual Super User

Hi @moraleseder,


Yes, sure. You can add an or function to the expression.


not(or(equals(triggerOutputs()?['body/from'], ''), equals(triggerOutputs()?['body/from'], ''))

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,062)