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

Super User II
Super User II

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?

Super User II
Super User II

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

MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (2,995)