cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Approval Reminders

I have approval reminders working until I get to the part in the Flow that uses a Switch.  The Switch is for additional approvers based on a dollar amount, my Do Until timing is off or something.  Is it possible to do a Do Until for Approval Reminders within a Switch Case?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @kmw1130, you cannot initialize a variable inside Switch but you can set a variable that has been initialized before. Please see how I handle this scenario in the following image.

 

Do-until-inside-switch-case.jpg

 

I observed a strange behavior when I was testing this today. When I added the Do Until inside the Switch Case, initially the basic condition editor did not let me select any operator. In fact, the operator field was disabled.  To overcome this problem, I clicked 'Edit in advanced mode' and then entered the formula @equals(triggerOutputs()?['body/TaskOutcome/Value'], 'Approved').  After that, when I clicked 'Edit in basic mode', the basic condition editor worked perfectly fine. Not sure this is a one-off issue, but something to watch out for, just in case.

 

Hope this resolves the problem you are facing.

View solution in original post

7 REPLIES 7
Resolver III
Resolver III

Hi @kmw1130 , I have used Do Until for approvals within a Switch Case without any problem. In your case, you seem to be using another Do Until inside the Switch Case branch. For additional approvals, I would use a separate Do Until after the close of the previous approval loop. Nesting the Do Until actions has some potential complexities, as the success of the parent Do Until would depend on the success of the nested Do Until, which is not desirable. If I didn't understand your question properly, could you please explain or show how your Do Until and Switch Case actions are set up?

Super User II
Super User II

If you could provide an expanded screenshot of your Flow and steps, your Flow run history, and of any detailed error messages you're receiving we could likely better assist you. Also, for the best results, you may want to review How to write a good forum post.

If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE.

@bibhupanigrahi @Brad_Groux 

Here are screenshots of my Flow.

 

Reminders work great for the 1st three approvers (PM > Div VP > FPA Dir.

Then at my Switch, if it is above 1M it will to BU SVP > FPA VP else Case 2 it goes to BU SVP > Pres > FPA VP > CFO.

flow-1.PNGflow-2.PNGflow-3.PNG

Hi @kmw1130 , it looks like at every other place you have the 'Do Until' action parallel to the 'Start and Wait for Approval' action, but inside the 'Switch Case', the 'Do Until' runs after the 'Start and Wait for Approval' action. Since 'Start and Wait for Approval' stalls the flow until a response is received, your 'Do Until' action won't run until the BU SVP approves. Once the BU SVP approves, the condition for this 'Do Until' won't be met, and this 'Do Until' will never run. Could you please confirm that is the issue? If yes, you can resolve it by having the 'Do Until' parallel to the BU SVP approval action.

 @bibhupanigrahi I had an issue doing the "Do Until" at the same level within the Switch.  The "Do Untils" outside of the Switch are at the parallel branch as the Scope, but am not able to do that within the Switch, unless I'm missing something.  I wasn't able to add the Initialize variable as the first action within the Scope, so the Initialize Variable is outside the Switch for what is inside the Switch.  This is the error I'm getting.  flow-error.PNG

Hi @kmw1130, you cannot initialize a variable inside Switch but you can set a variable that has been initialized before. Please see how I handle this scenario in the following image.

 

Do-until-inside-switch-case.jpg

 

I observed a strange behavior when I was testing this today. When I added the Do Until inside the Switch Case, initially the basic condition editor did not let me select any operator. In fact, the operator field was disabled.  To overcome this problem, I clicked 'Edit in advanced mode' and then entered the formula @equals(triggerOutputs()?['body/TaskOutcome/Value'], 'Approved').  After that, when I clicked 'Edit in basic mode', the basic condition editor worked perfectly fine. Not sure this is a one-off issue, but something to watch out for, just in case.

 

Hope this resolves the problem you are facing.

View solution in original post

@bibhupanigrahi That seems to work.  I'm going to add them to all of my Approvals within the Switch Cases and do a final test.

Thank you.

 

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (6,919)