web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : lf0j3SQK25UEmxI5y6T6F9
Power Automate - Building Flows
Answered

Do until not exiting once condition is met

Like (1) ShareShare
ReportReport
Posted on 21 Nov 2022 04:41:39 by 12

Hi folks, i hope one of the power automate community might be able to help me out. I have a flow that is doing everything I want except for one part.

 

I have a task that is being created in planner.

I want the flow to wait until the task is completed and then as a final step update a sharepoint list.

 

The issue I'm running into is that once the task is completed it does not exit the "do until" until either the retry or timeout count has reached the maximum.

 

For testing purposes and to save time i have set my retry count to 3

as you can see on the first run through the percentage complete value is 0 which is expected as the task is not completed

NicoCron_0-1669004677965.png

 

On the second time around you can see that the percentage complete value has now changed to 100 (Which means the task has been completed)

NicoCron_1-1669004817411.png

 

The same is true for the third time around at which point because i have a retry count of three it exits and goes to the next step.

The issue is that when it reached count 2 and the percentage complete was now 100, it should have exited the "do until", it should not have reached the third round (i may be completely misunderstanding what i have read about do until loops though)

 

My assumption was that once the percentage complete was 100, the variable that is getting set with "percentage complete" would be 100 and hence the condition of "status = 100" would be met and it would exit the do until condition

NicoCron_2-1669004942980.png

 

While working with small timeframes this is fine, but i want my delay to be daily not minutely and run for 30 days. I cant have the sharepoint list updating on day 30 if the task was actually completed on day 2.

 

On a side not, is percentage complete the only way to tell if a task in planner is complete? I am surprised that there is no task status.

I have the same question (0)
  • grantjenkins Profile Picture
    11,059 Moderator on 21 Nov 2022 at 05:57:43
    Re: Do until not exiting once condition is met

    Looking at your logic it shouldn't continue to the third iteration.

     

    However, wondering why you're not just using the trigger When a task is completed? This will fire as soon as you complete the task which seems more suitable.

    grantjenkins_0-1669010234217.png

     

  • NicoCron Profile Picture
    12 on 21 Nov 2022 at 21:57:46
    Re: Do until not exiting once condition is met

    Hi and thanks for the fast reply, from looking at that it is a trigger and not an action, it would be a good way to kick off a workflow when any task is closed in that planner, however, I don't see a way to match it back against the taskID, as the last step of the flow is to update a SharePoint item to say that the process is now complete.

     

    What I'm wondering and this may be my lack of understanding of the platform being so new to it.

    This workflow is for salary expenses. Let's say two people submit one within a few minutes of each other.

    Once the task had been completed by the finance person and they had reimbursed the money, how would the "task completed" trigger know which one of the reimbursement records in Sharepoint to mark as completed?

     

    Im still really interested to know why the do until is not exiting once the condition is met if anyone has any insight to this

     

  • Verified answer
    grantjenkins Profile Picture
    11,059 Moderator on 22 Nov 2022 at 03:43:08
    Re: Do until not exiting once condition is met

    I did some testing and some crazy stuff going on here - I might look into it further to see why the condition doesn't match when it's 100.

     

    As a workaround you can try the following.

    grantjenkins_0-1669088246058.png

     

    Initialize your variable as a Boolean set initially to false. I've named the variable completed.

    grantjenkins_2-1669088477254.png

     

    In the condition check to see if the value of the variable is equal to true (use an expression for true).

    grantjenkins_1-1669088446697.png

     

    When you set your variable use the following expression will evaluate to true if it's equal to 100.

    equals(outputs('Get_a_task')?['body/percentComplete'], 100)

    grantjenkins_3-1669088519847.png

     

  • NicoCron Profile Picture
    12 on 22 Nov 2022 at 23:52:35
    Re: Do until not exiting once condition is met

    Thank you @grantjenkins so much, your workaround has behaved exactly as I thought my original method would have. Thanks again you have saved what little hair I have left. I have no idea why the original method was not working but it appears to be a bug (or feature) in the platform.

  • grantjenkins Profile Picture
    11,059 Moderator on 23 Nov 2022 at 00:32:29
    Re: Do until not exiting once condition is met

    Yea agree that it's a bug. I'll log something with Microsoft to see if it's known and working on it or do some further investigation.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard
Loading started
Loading complete