cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ck25415
Level 8

Identify which condition failed in a condition control

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,

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Identify which condition failed in a condition control

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#l...

 

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.

7 REPLIES 7
Super User
Super User

Re: Identify which condition failed in a condition control

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
Level 8

Re: Identify which condition failed in a condition control

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

Super User
Super User

Re: Identify which condition failed in a condition control

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

Community Support Team
Community Support Team

Re: Identify which condition failed in a condition control

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#l...

 

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
Level 8

Re: Identify which condition failed in a condition control

@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#l...

 

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.


 

Community Support Team
Community Support Team

Re: Identify which condition failed in a condition control

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%3Doff...

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
Level 8

Re: Identify which condition failed in a condition control

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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 368 members 4,544 guests
Please welcome our newest community members: