This article is contributed. See the original author and article here.
The default behavior of the Until Loop is to Succeed if all actions inside it are successful, and depending on your run after behavior, when the Loop limit is reached. This behavior can be changed from the code view of the Logic App.
The default behavior:
Actions are Successful, the Loop hits the limit and returns Success as all actions were successful. The limit was hit but the result is Success for the Loop.
Add loops to repeat actions – Azure Logic Apps | Microsoft Docs
Let’s say you wish to change this behavior and you require the Until Loop to fail when it reaches the Loop Limit.
Fail Loop when limit is reached behavior:
To let the Until Loop fail when the limit is reached; just add the below in the code behind in the JSON of the Until Loop, this option is not available in the GUI yet (at the time of writing this blog):
“operationOptions”: “FailWhenLimitsReached”,
“Until_2”: {
“actions”: {
“Execute_stored_procedure“: {
………………………..
}
},
“expression”: “@equals(variables(‘myUntilStop’), true)”,
“limit”: {
“count”: 5,
“timeout”: “PT1H”
},
“operationOptions“: “FailWhenLimitsReached“,
“runAfter“: {
“Initialize_variable_8”: [
“Succeeded“
]
},
“type”: “Until”
}
and this is how to do it! As easy as that.
Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.
Recent Comments