Steps to reproduce:
Create a flow with a do until loop, and an approval task in the loop. Use a dynamic field as the "assigned to". If the assigned to field has an appropriate value, the flow should work fine. If the assigned to field is empty, the action will fail, but the loop will continue executing. I expected the entire flow to fail, as it normally does when encountering an exception.
Could you please share a screenshot of the configuration of your flow?
I have made a test on my side, if the assigned to field is empty, the flow would continue to run until the Do Until is finished, and when the Do Until is finished, we could see the error message inside the each loop in the Do Until.
Do you want your flow would fail immediately in the loop if the assigned to field is empty?
If yes, I afriad that you couldn't achieve your requirement in microsoft flow currently, because the Do Until would continue run until it is finished event if one loop has run failed.
As you can see below, in the loop, an email is sent, followed by an approval, followed by another email. In this case, I ran it without a value in the approver field, so the approval step was guaranteed to fail. Note that the follow-up email that is after the approval was never sent. This makes sense, as the approval action failed, and so that action was not reached. However, the loop kept looping, despite the failure. The end result is that over a several minute period, I received 60 emails (from the first send an email action in the loop). Apparently, after 60, the system decided to cut it off. Curiously, the error message doesn't say anything about hitting a maximum number of loops, but rather states: "The request failed. Error code: 'InvalidApprovalCreateRequestAssignedToMissing'. Error Message: 'Required field 'assignedTo' is missing, empty, or contained no valid users.'."
Again, I would expect the flow to fail and stop executing, like it does when there is no loop. Or, I would expect a set of options for the loop that would allow me to select a behavior for when there's an error. But simply having the loop try to execute 60 times in a row is unwanted, and could result in a huge problems if business users are suddenly spammed with 60 emails.
One quick addition: in this case, the condition that will exit the loop is if the item is approved, which would seem to be a common business scenario.
The Do Until would continue run until it is finished event if one loop has run failed in microsoft flow currently.
If you want the Do Until would run failed immediately when one loop has run failed, you could submit an idea to Microsoft flow Idea Forum:
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Many congratulations to the Season 1 2021 Flownaut Crew!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
Check out the community blog page where you can find valuable learning material from community and product team members!