Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Do until Loop

(0) ShareShare
ReportReport
Posted on 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,489 Super User 2025 Season 1 on at
    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 at
    Re: Do until Loop

    could you show me an example?

  • David_MA Profile Picture
    11,489 Super User 2025 Season 1 on at
    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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May 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 >