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 Apps / for loop in power apps
Power Apps
Answered

for loop in power apps

(0) ShareShare
ReportReport
Posted on by 23

Hi Team,

I need for loop in power apps but I don't see this. Is for loop available in PowerApps? Is forAll() replacement for For loop in PowerApps? Could you please share a sample code to build for loop in PowerApps.

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @KrithiAnaje ,

     

    Documentation Link

     

    Here are some examples,

    Later, if you have further question while you code your logic then you can ask

     

    Hope this helps

  • KrithiAnaje Profile Picture
    23 on at

    I would like to have for loop to make concurrent calls to automate flow to get items by some batch of item IDs may be by specifying start, end and increment operator in the loop.

  • v-bofeng-msft Profile Picture
    on at

    Hi @KrithiAnaje ,

     

    You could create a timer control to do the loop.

     

    Please check this link:
    https://www.dynamicpeople.nl/en/news/while-loop-powerapps/

     

    Best Regards,

    Bof

  • KrithiAnaje Profile Picture
    23 on at

    Thank you. I want to auto-start the timer on page load itself (not on button click). I tried to set below code on OnVisible property of the screen, but still the loop execution starts after I click the timer instead of page load,

    UpdateContext({varStartTimer: false});
    UpdateContext({varRuns: 0});
    UpdateContext({varStartTimer: true});

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @KrithiAnaje ,

     

    You could set the timer's AutoStart property to true to auto-start the timer.

     

    Best Regards,
    Bof

  • KrithiAnaje Profile Picture
    23 on at

    I have initialized UpdateContext({varRuns: 0}); in the OnVisible property of screen, but the loop is not working as expected. It must start with 0 and then increment by 1 but I get values like 26 in OnTimerEnd even though LoopEnd value is 5. The code If(varRuns > (varLoopEnd-1), UpdateContext({varTimerStart: false})); this is keep on running without stopping the timer.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard