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

Do until doesn't work: only first loop works

Hi,

 

I am creating a flow that notifies each person of the hierarchy when someone creates a PO in D365 Finance and Operations.

Here is my example:

  1. The orderer's position is Consultant 1
  2. He reports to Manager1 (called, Mana Ger1)
  3. This manager reports to Director1 (called Direc Tor1)

 

I try to make a 'Do until' loop, to search each time the manager and send him a message on Teams, but only the Manager1 is reached, the loop doesn't go for the Director1, whereas the variable I use is well initialized for that.

Here are printscreens for that flow:

11001.png

As you can see, the flow is on success:

1101.png

For the first step, the Manager1 is well found:

1102.png

111.png

At the end of the loop, the variable is initialized with the good value 'Director1':

112.png

And the variable for the loop is also well set with the value ok...

So I don't understand why the flow doesn't go for an other loop with these values...

 

Can someone help me on this?

Thansk in advance!

 

 

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User II
Super User II

Hello @Frog64 ,

The 'Do until' condition tells the action when to stop. In your case it's defined in a way that it should 'Do until VarLoop is equal to ok'.

If you set the VarLoop to 'ok' in the first run then in the next run the 'Do until' will check the condition: it's true (VarLoop is equal to 'ok'), move out of the 'Do until'. You should set it to 'ok' only when you want to leave the loop, or change the 'Do until' condition.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ ... and if you like my response, you might like also the tips and solutions on my Power Automate related blog ]

View solution in original post

Dual Super User II
Dual Super User II

Hi @Frog64 

 

The do until will only run the iterations based on the value in the variable that you have set. In the flow run, it shows that the no branch has run and the value was set to ok. This means that the do until has found the variable value as ok and it will stop executing now. 

 

In the edit mode, I can see that in the condition you are checking that the variable value is equal to and there is no value in the right side box. Is this how you want it to be? If you are checking that the variable value is blank, you can use the empty function around the variable and check if that is true. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

3 REPLIES 3
Super User II
Super User II

Hello @Frog64 ,

The 'Do until' condition tells the action when to stop. In your case it's defined in a way that it should 'Do until VarLoop is equal to ok'.

If you set the VarLoop to 'ok' in the first run then in the next run the 'Do until' will check the condition: it's true (VarLoop is equal to 'ok'), move out of the 'Do until'. You should set it to 'ok' only when you want to leave the loop, or change the 'Do until' condition.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ ... and if you like my response, you might like also the tips and solutions on my Power Automate related blog ]

View solution in original post

Dual Super User II
Dual Super User II

Hi @Frog64 

 

The do until will only run the iterations based on the value in the variable that you have set. In the flow run, it shows that the no branch has run and the value was set to ok. This means that the do until has found the variable value as ok and it will stop executing now. 

 

In the edit mode, I can see that in the condition you are checking that the variable value is equal to and there is no value in the right side box. Is this how you want it to be? If you are checking that the variable value is blank, you can use the empty function around the variable and check if that is true. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helper I
Helper I

Thanks for your help!

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

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 (8,495)