web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Condition with groups ...
Power Automate
Unanswered

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.

Categories:
I have the same question (0)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @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

     

     

  • dennisonlee Profile Picture
    6 on at

    @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'.

     

     

     

     

  • Verified answer
    rsaikrishna Profile Picture
    3,703 on at

    @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

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

     

    Thanks @rsaikrishna 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard