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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Working with Condition...
Power Automate
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

 

 

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    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

  • Rob_CTL Profile Picture
    on at

    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.

  • Rob_CTL Profile Picture
    on at

    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

  • Verified answer
    Rob_CTL Profile Picture
    on at

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

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 378

#2
Valantis Profile Picture

Valantis 329

#3
David_MA Profile Picture

David_MA 283 Super User 2026 Season 1

Last 30 days Overall leaderboard