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

Community site session details

Session Id : uhPjHLoW1Ll2HEAzPrZsA1
Power Automate - Using Flows
Answered

Working with Conditions - OR

Like (0) ShareShare
ReportReport
Posted on 11 Sep 2017 17:28:15 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

 

 

I have the same question (0)
  • v-yamao-msft Profile Picture
    on 12 Sep 2017 at 07:58:30
    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

  • Rob_CTL Profile Picture
    on 12 Sep 2017 at 08:12:21
    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.

  • Rob_CTL Profile Picture
    on 12 Sep 2017 at 10:47:21
    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

  • Verified answer
    Rob_CTL Profile Picture
    on 12 Sep 2017 at 11:09:26
    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'))

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard

Featured topics

Restore a deleted flow
Loading complete