cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
moraleseder
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 https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Create-Planner-Task-and-Include-At...

 

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

moraleseder_0-1624458397428.png

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

3 REPLIES 3
Expiscornovus
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 email@contoso.com value by the e-mail address you want to exclude.

 

 

@not(equals(triggerOutputs()?['body/from'], 'email@contoso.com'))

 

 

triggercondition_notfrom.png

Can I add multiple emails?

Expiscornovus
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'], 'email@contoso.com'), equals(triggerOutputs()?['body/from'], 'email2@contoso.com'))

Helpful resources

Announcements
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)