Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Condition with groups not working as expected

(0) ShareShare
ReportReport
Posted on by 6

 

Here's the condition

dennisonlee_1-1592603701976.png

the first group evaluates: toLower(TriggerBody()?['from']) = the above example email addresses

the second group evaluates: toLower(TriggerBody()?['subject']) does not contain the above example words

 

What's happening?  If Group1 evaluates true, Group2 is ignored, when it shouldn't be. I can even change the does not contain to contains and the result is still the same. 

 

I've even gotten rid of all the blocks and used the advanced expression:

and(or(equals(toLower(triggerBody()?['from']),'1@emailaddress.com'),equals(toLower(triggerBody()?['from']),'2@emailaddress.com')),or(not(contains(toLower(triggerBody()?['subject']),'test')),not(contains(toLower(triggerBody()?['subject']),'alert'))))

 

Same result.

 

Tried swapping group positions. Same result.

 

Desired result examples:

From: 1@emailaddress.com

Subject: this is a test

This should evaluate false.

  • dennisonlee Profile Picture
    6 on at
    Re: Condition with groups not working as expected

    Changing that second group's condtions to AND looks to be working. 

     

    Thanks @rsaikrishna 

  • Verified answer
    rsaikrishna Profile Picture
    3,703 on at
    Re: Condition with groups not working as expected

    @dennisonlee 

     

    You should use AND between Subject conditions.

     

    Created a sample for your requirement:

    1.JPG

    2.JPG

     

    Output:

    3.JPG

    4.JPG

     

    Regards

    Krishna Rachakonda

    If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

     

  • dennisonlee Profile Picture
    6 on at
    Re: Condition with groups not working as expected

    @edgonzalesThanks for you reply.

     

    When you say the second group is 'ignored', what does that mean?

    Meaning, it doesn't matter if the subject has the words test or alert or doesn't have any of those words.  This is only applicable if the first grouping which tests for the email addresses is true.  This absolutely works if I take out the first group testing for the email addresses.

     

    And then when you switch to "does contain", what (exactly) happens?

    As with the above answer, if the first grouping is true, switching to 'does contain' will give the same result as 'does not contain'.  Every result is True even on identical subject lines,

     

    The overall intent is:

    If an email is from either of those 2 email addresses, it should return true for every subject EXCEPT if the subject contains 'test' or 'alert'.

     

     

     

     

  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at
    Re: Condition with groups not working as expected

    @dennisonlee 

    Hey there. This will get a bit weird, I think...but let's start with some questions:

    • When you say the second group is 'ignored', what does that mean?
    • And then when you switch to "does contain", what (exactly) happens?

    The Does Not Contain with an Or is going to make things weird because if your subject is "Red alert ! All crew to battle stations!" it will pass as "True" for the second group because it does not contain the word Test...which I think is the opposite of your intent, right?

     

    What is the overall intent, also, of your flow?

     

    Thanks,

    Ed

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1