Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Working with Conditions - OR

(0) ShareShare
ReportReport
Posted on by

Hi,

 

 

I've got a shared mail box, lets call is Mailbox1 and 2 SharePoint lists, lets call them Success and Failed.

 

What I am trying to achieve is that when a mail arrives at Maibox1 it is picked up by a Flow. The flow looks at the subject line of the email and this will determine which list the email gets sent to.  If the subject line contains either the word "success" or "Successful" it will get sent to the "Success" SP list.  If the subject line contains anything else then it will go to the "Failed" SP list.

 

Can I put an "OR" in the @contains condition?  at the moment I just have the one word, success but I'd like to add an OR to also look for "successful"

 

Current condition query:

 

 

@contains(triggerBody()?['Subject'], 'success')

 

Any help gratefully received.

Rob

 

 

  • Verified answer
    Rob_CTL Profile Picture
    on at
    Re: Working with Conditions - OR

    I spoke to soon, spotted the issue....the code is missing a , after 'success') 

     

    This works:

     

    @or(contains(triggerBody()?['Subject'], 'success'),contains(triggerBody()?['Subject'], 'successful'))
  • Rob_CTL Profile Picture
    on at
    Re: Working with Conditions - OR

    Hi Mabel

     

    I've just had a play with the code and it's throwing an error stating that the query failed with "Unable to parse template language expression"

     

    Any thoughts?


    Thanks

    Rob

  • Rob_CTL Profile Picture
    on at
    Re: Working with Conditions - OR

    Thanks for the reply Mabel.  It appears that the original query is working as is, I thought the condition was explicit but it appears it isn't.  You learn something new everyday 🙂  However your code will be useful for some other stuff I am trying so thank you for that.

  • v-yamao-msft Profile Picture
    on at
    Re: Working with Conditions - OR

    Hi Rob_CTL,

     

    Please check the part Logical functions about Or in this doc on workflow definition language for a reference:
    https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

     

    In your case, the function might be configured as:

     

    @or( contains(triggerBody()?['Subject'], 'success')
     contains(triggerBody()?['Subject'], 'successful')
     )

     

    Please try it on your side.

     

    Best regards,
    Mabel Mao

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

Featured topics

Restore a deleted flow