Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Connectors
Answered

Do until is not stopping after the variable met the condition of loop termination

(0) ShareShare
ReportReport
Posted on by 18

I was doing automation for exporting a table for 10 stores and save as a csv file from Power BI to sharepoint. 

 

The output of the flow is good, but the flow does not stop as defined. 

 

At first, I was thinking maybe I shall put the 'Increment variable' outside of 'Apply to each', but not working. 

 

Then, I was thinking maybe the 'Apply to each' shall only include 'Create file in sharepoint', still not working. 

 

Could someone help me to see which step did I do wrong? The variable 'StoreIndex' does increment, but the stopping point 'StoreIndex' <= 3 is not executed. 

 

Below are two versions of this flow. 

 

0.png1.png

 

Thanks in advance. 

  • Verified answer
    TreeTreeTree Profile Picture
    18 on at
    Re: Do until is not stopping after the variable met the condition of loop termination

    The 'Apply to each' is the cause of endless loop for this case and the cause of 'Apply to each' automatically added for a step is the referring of Power BI Columns. 

  • TreeTreeTree Profile Picture
    18 on at
    Re: Do until is not stopping after the variable met the condition of loop termination

    I kind of figured out it was caused by referring Power BI columns while creating sharepoint files, the Power BI column involvement forced the step to be put in 'apply to each'. Without referring Power BI columns, the 'apply to each' is not automatically added. Continuing fixing the issues. This brings a point that the variable 'StoreIndex' defined in Power Automate is not equivalent to the 'StoreIndex' column I defined in Power BI. They are parallel independent code running by themselves, even though I use one to model the value of the other. 

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 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics