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 / Identify which conditi...
Power Automate
Answered

Identify which condition failed in a condition control

(1) ShareShare
ReportReport
Posted on by 294

Hello,

 

I have condition control block wtih multiple condition inputs(10) in it, is there a way to identify which condition failed in the condition control. I would like to log the failed condition in a comments field of the Sharepoint list item.

 

Is there a way to do it other than splitting the condtion block into 10 different condition actions and appending the failed condition into a variable at the failed instances and updating it into sharepoint item in the last step.

 

Please let me know.

Thanks,

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,143 on at

    Hi @ck25415 

     

    You would have to set configure run after for all your condition block actions (parallel branch)

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • ck25415 Profile Picture
    294 on at

    @RezaDorrani 

     

    Do you mean split my block of conditions into multiple conditions(parallel branched) and use configure run after to log failed actions?

     

    Do you think logging all failed conditions with a descriptive message (something like condition "name" failed: "value") about each failed action is possible with this design? I am thinking of appending the custom message into a string variable in the "No case" of all the parallel conditions and use it later to log. I am not sure if its a good idea to use the same string variable to append in parallel branching... should I be using different variables for all the conditions?

     

    Please comment.

  • RezaDorrani Profile Picture
    12,143 on at

    Hi @ck25415 

     

    You can even mix it up with scopes (this is error handling)

    https://veenstra.me.uk/2018/06/06/microsoft-flow-advanced-error-handling-throw-in-flow/

     

    Now reading your post again looks like you have a condition block that has multiple conditions and finally evaluates to true or false

    and you want to know which block evaluated to false

    Then  if your condition is false, you can add individuals conditions after that to check each condition and see which one evaluated to false to log in to list item

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @ck25415,

     

    Cause you have 10 conditions to fitter the items in your SharePoint and you want to identify which condition was failed after a run, right? Maybe you could make a workaround that uses the Compose action to put each condition into it. 

    For example, you can use the expression:

    if(equals(item()?['title'],'test'),true,false)

    it has the same function as the condition Title is equal to 'test'.

    Annotation 2019-08-26 125833.png

    So, you can create a branch to put the ten condition into these Compose action.

    Annotation 2019-08-28 143450.png

     

    About greater, less, and, etc logical comparison functions, you can have a reference to this document:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#logical-comparison-functions

     

    Hope it can help you.

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ck25415 Profile Picture
    294 on at

    @RezaDorrani @v-litu-msft Thank you for the suggestions.


    @v-litu-msft wrote:

    Hi @ck25415,

     

    Cause you have 10 conditions to fitter the items in your SharePoint and you want to identify which condition was failed after a run, right? Maybe you could make a workaround that uses the Compose action to put each condition into it. 

    For example, you can use the expression:

    if(equals(item()?['title'],'test'),true,false)

    it has the same function as the condition Title is equal to 'test'.

    Annotation 2019-08-26 125833.png

    So, you can create a branch to put the ten condition into these Compose action. Annotation 2019-08-26 130625.png

    About greater, less, and, etc logical comparison functions, you can have a reference to this document:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#logical-comparison-functions

     

    Hope it can help you.

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


     

  • v-litu-msft Profile Picture
    on at

    Hi @ck25415,

     

    Have you solved your problem?

    I find another way to identify which condition failed, so I want to update it for you.

    In the SharePoint have a type of column named Calculated, it will according to the condition of a statement and return a Yes or No value. You can have a reference to this document: https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/bb862071(v%3Doffice.14)

    So if you have ten conditions in your Flow and will use the value of the item list, you can preset in the column for ten conditions, if it was failed, you can get the 'No' directly.

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ck25415 Profile Picture
    294 on at

    Hello @v-litu-msft ,

     

    Thanks for the suggestion. I will be using the compose action to validate conditions and log the outputs of it as our new requirements is to log all outcomes of every condition.

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard