Skip to main content
Community site session details

Community site session details

Session Id : f+5YtW4kSpCSwRpYcItTFu
Power Automate - Building Flows
Answered

Do until Loop

Like (0) ShareShare
ReportReport
Posted on 29 Feb 2024 13:30:27 by 92

I want to do the follwing think

I have several data records and one part of the data record contains a timestamp. I would now like to compare each one until it is older than the one I am comparing with. I was thinking of a Do until. To increment the count, I incremented a counter after each run to have the next data set to compare.
I tried to do this with the following function. Unfortunately this does not work. where is my error in thinking

 

@{outputs('Bearbeiter_Filtern_nach_KTG-Online')?['body'][variables('Counter')]?['LetzteZuweisung']}

 

  • Verified answer
    David_MA Profile Picture
    11,776 Super User 2025 Season 2 on 29 Feb 2024 at 14:27:15
    Re: Do until Loop

    This example is looking for a number in a list of items that equals 313. Same idea as what you are trying to do:

    David_MA_0-1709216563212.png

    1. Get your items
    2. Set a Boolean variable to false that you will use to tell the Do until when to stop
    3. The do until:
      David_MA_1-1709216630499.png
    4. Apply to each on each item from the Get items action
    5. Condition you want to process until it finds a match (in my example, where a number equals 313).
    6. If it finds a match, on the yes side set the Boolean variable you initialized for the Do until to false so it stops.
    7. Then the compose action is just to validate that it found the match, which in this example was found on the 8th item:
      David_MA_2-1709216827884.png

       




  • CU05080900-1 Profile Picture
    92 on 29 Feb 2024 at 14:00:01
    Re: Do until Loop

    could you show me an example?

  • David_MA Profile Picture
    11,776 Super User 2025 Season 2 on 29 Feb 2024 at 13:54:52
    Re: Do until Loop

    Inside your do until, are you using an Apply to each to compare all of the items until it finds an older one? If not, try it that way.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading started
Loading complete