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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / For Each - INCREASE Cu...
Power Automate
Answered

For Each - INCREASE CurrentItem variable without reaching END step

(0) ShareShare
ReportReport
Posted on by 145

Good day Everyone,

 

First, is this possible?

 

I'm trying to update something and i wanna do it through PA, everything is perfect just one step away from heaven.

 

The CurrentItem does not increase because it doesn't reach the END action because i placed a 'EXIT LOOP' right behind it. Is it possible to increase? or there's another way to make it without using foreach?

 

Capture.PNG

 

Please help.

I have the same question (0)
  • UK_Mike Profile Picture
    on at

    Remove the " exit loop " surely ? then it will iterate through list...

  • Davidx23 Profile Picture
    145 on at

    UK_Mike

     

    Thing is i need to match the ID value with the CurrentItem Value in order to update it in DB.

  • UK_Mike Profile Picture
    on at

    Well ive no idea about Sql but that flow is doing exactly what you said to do, Exit the loop after 1 iteration.

    You could try a regular loop, specify the times to loop or loop to the List.count...

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Are you saying Exit Loop is taking it out of both loops, and not just the second Loop?

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Next takes is to the Next iteration, but End naturally does the same thing.

    Example:

     

    For each

    'Do something

    Next

    End

     

    For Each

    'Do something

    End

     

    They are the same thing.  Next is typically used when you are trying to skip the rest of the steps in the loop based on a conditional statement.

    Ex.

    For each

    If %CurrentItem.Name% = John

        Next

    End (if)

    'Do something (will only occur if %CurrentItem.Name% is not John)

    End (for each)

     

    Exit Loop cancels out a loop completely, so as I read it, you are telling it to only iterate once on the second loop, because you are telling it every time to exit this loop.

  • UK_Mike Profile Picture
    on at

    Just had a second glance at the screenshot, If theres only 1 file in the current item it would end anyway...🤔

  • Verified answer
    Davidx23 Profile Picture
    145 on at

    Guys,

     

    I did find the solution by my own, just rebuilt the flow and make the consult in a Store Procedure by its row's ID, updated the same way and that was bbq chicken.

     

    Thanks anyway and i'll share the flow if may be helpful for someone else.

     

    Capture.PNG

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard