cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
svcMon
New Member

‘OR’ Statements conditions are not working exactly

I have a Flow that applies to all emails coming from a specific sender. (step 1)

I then added condition where, it should look at the Subject and filter based on keywords (multiple keywords using 'Or' Statement)  (step 2)

If above condition is met, checks for another condition that looks for a specific keyword in the Body of the email (step 3)

If condition is met again, does another check for a specific phrase on the Subject line. (step 4)

if condition is still met, then sends an email. (step 5)

 

now everything seems to be working all the way to sending the emails, except it is actually not doing the filtering at the first condition using the 'Or' Statement (step 2)

 

so basically

step 1 - it checks for specific sender email

step 2 - skips

step 3 - checks for condition that looks for a specific keyword in the Body of the email

step 4 - check for a specific phrase on the Subject line.

step 5 - sends an email.

 

i dont understand why the filtering on step 2 is not applying at all

 

alertflow.PNG

3 REPLIES 3
v-yamao-msft
Community Support
Community Support

Hi @svcMon ,

 

From your description, it seems that the Condition 8 will be skipped. Could you provide the complete statement used in Condition 8?

 

I have made a similar flow likes below, please check it for a reference.

 

The trigger is When a new email arrives.

 

Then the condition with the following function to filter subject based on multiple keywords using Or:

 

or(contains(triggerBody()?['Subject'],'UP1'),contains(triggerBody()?['Subject'],'dp2'),contains(triggerBody()?['Subject'],'ab3'))

is equal to

True

 

 

Then Condition 2 to check if the body contains specific word:

 

contains(triggerBody()?['Body'],'test')

is equal to

True

 

 

Under if yes branch, send an email.

1.PNG

 

By the way, there are some updates in Condition, please check the following blog:

https://flow.microsoft.com/en-us/blog/build-more-powerful-conditions-in-flows-and-more/

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thanks Mabel

 

the complete text in Condition8 is below

 

@or(contains(triggerBody()?['Subject'], 'up1'), contains(triggerBody()?['Subject'], 'up4'), contains(triggerBody()?['Subject'], 'dp3'), contains(triggerBody()?['Subject'], 'xp2'), contains(triggerBody()?['Subject'], 'ewp'), contains(triggerBody()?['Subject'], 'upb'), contains(triggerBody()?['Subject'], 'upj'), contains(triggerBody()?['Subject'], 'sma'), contains(triggerBody()?['Subject'], 'up5'))

 

 

noting that i dont have the below as part of the text in my conditions

 

is equal to

True

 

 

 

Hi @svcMon ,

 

I assume that your flow was created before the new advanced condition builder released.

 

From the blog we know that we could also add a condition to your flow by selecting New step, please take a try with it.

 

If possible, please recreate the condition to see if it will work.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Users online (942)