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,
Solved! Go to Solution.
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'.
So, you can create a branch to put the ten condition into these Compose action.
About greater, less, and, etc logical comparison functions, you can have a reference to this document:
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.
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
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.
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
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'.
So, you can create a branch to put the ten condition into these Compose action.
About greater, less, and, etc logical comparison functions, you can have a reference to this document:
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.
@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'.
So, you can create a branch to put the ten condition into these Compose action.
About greater, less, and, etc logical comparison functions, you can have a reference to this document:
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.
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.
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.