Skip to main content
Microsoft logo
Power Apps
    • AI Builder
    • Automate processes
    • Azure + Power Apps
    • Build apps
    • Connect data
    • Portals
  • Pricing
    • Overview
    • Become a Partner
    • Find a Partner
    • Find consulting services
    • Blog
    • Customer stories
    • Documentation
    • Roadmap
    • Self-paced learning
    • Webinars
    • Overview
    • Issues
    • Give feedback
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • Register
    • ·
    • Sign In
    • ·
    • Help
    Go To
    • Power Apps Community
    • Get Help with Power Apps
    • Building Power Apps
    • Microsoft Dataverse
    • AI Builder
    • Power Apps Governance and Administering
    • Power Apps Pro Dev & ISV
    • Power Apps Portals
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Community Blog & News
    • News & Announcements
    • Power Apps Community Demo Extravaganza 2020
    • Galleries
    • Community App Samples
    • Webinars and Video Gallery
    • Canvas Apps Components Samples
    • Kid Zone
    • Business Value Webinars and Video Gallery
    • Emergency Response Gallery
    • 2019 Microsoft Business Applications Summit Recordings (Archived)
    • Microsoft Business Applications Summit 2020 Session Recordings
    • Ideas
    • Power Apps Ideas
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Power Apps Community
    • Galleries
    • Community App Samples
    • Definite and Indefinite Looping in PowerApps

    Definite and Indefinite Looping in PowerApps

    09-13-2020 15:16 PM

    Super User III KrishnaV
    Super User III
    331 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    KrishnaV
    Super User III KrishnaV
    Super User III
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    Definite and Indefinite Looping in PowerApps

    ‎09-13-2020 03:16 PM

    Hi PowerAddicts,

     

    This video is all about how to implement looping in PowerApps.

     

    In this video, I have covered 3 different ways of implementing loops in PowerApps:

    1. Using timer control
    2. FirstN function
    3. Toggle control

    You can download the app from https://github.com/krishnaVSU2020/PowerAppsLooping/blob/master/Definite%20And%20Indefinite%20Lopping...


    Import the App using the "Import canvas App" option available in the Apps left navigation menu of https://make.powerapps.com/

     

    Thank You,

    Krishna Vandanapu

    PowerApps SuperUser

    Youtube
    Twitter

    watch?v=mmeDv6b1Zhg


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Proud to be a Super User!

    Regards,
    KrishnaV
    Business Applications MVP
    Twitter | Linkedin | YouTube | GitHub
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
    Labels:
    • Labels:
    • Galleries and forms
    • Mobile app design and user experience
    Message 1 of 2
    331 Views
    4 Kudos
    Reply
    • All posts
    • Previous Topic
    • Next Topic
    Gabrz
    Gabrz Advocate III
    Advocate III
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    ‎10-09-2020 02:07 AM

    Hi KrishnaV,

    In the third example, you could use "Mod(varItrCount,2)=1" as the Default of the tglLoop. (Odd is true and Even is false) Then you don't have to use the separate Variable "varLoop" anymore.

    And in the OnChange you don't have to Select the Button, you can handle everything inside the OnChange.

     

    If(
        varItrCount > 0 && varItrCount <= Value(txtItrCnt.Text),
        // Collect and increment Counter
        Collect(
            collTable,
            {tblRowVal: txtTblNum.Text & " X " & varItrCount & " = " & varItrCount * Value(txtTblNum.Text)}
        );
        UpdateContext({varItrCount: varItrCount + 1}),
        // Else : Reset Counter
        UpdateContext({varItrCount: 0})
    )

     

    The code in the Button could then just be

    Clear(collTable);
    UpdateContext({varItrCount:1})

     

    Regards,

    Gabrz

    Message 2 of 2
    202 Views
    0 Kudos
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Automate
    • Power Virtual Agents

    Power Apps

    • Sign in
    • Sign up

    Browse

    • Sample apps
    • Services

    Downloads

    • Studio
    • iOS
    • Android

    Learn

    • Documentation
    • Support
    • Community
    • Give feedback
    • Blog
    • Partners

    • © 2021 Microsoft
    • Follow Power Apps
    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks