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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Looping in powerapps
Power Apps
Suggested Answer

Looping in powerapps

(0) ShareShare
ReportReport
Posted on by 123
Hi Everyone, hope all are doing well!

I have an PowerApps that is meant be used as a checklist as first and then, depending on the input, create a note that says what is missing.
The tool is used to check forms that people sent to us.

My issue is that, at some point, users needs to check  some 10 items for each person and there can be like 15 persons..
In the first image I show how the screen looks like with 2 persons (as I said, there can be like 15 persons). It would be a scroll down.

For now my approach has always been: building a collection for each person as seen in the following image 2 (the code is incomplete but the logic is there).


My question is: Is there a shorter way?
Can I use a looping function to not have to code huge collections for each of the possible 15 persons?


Thank you in advance!
2.PNG
1.PNG
I have the same question (0)
  • Suggested answer
    SaiRT14 Profile Picture
    1,992 Super User 2025 Season 1 on at
    pls try the following:
     
    Instead of creating multiple collections, structure a single collection
    Use the ForAll and Collect functions to dynamically generate a single collection for all persons.
    // Define persons and checklist items
    ClearCollect(
        ChecklistCollection,
        ForAll(
            Sequence(15), // 15 persons
            ForAll(
                ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10"], // Checklist items
                {
                    PersonID: Value, // Current person from Sequence
                    ChecklistItem: Value, // Current checklist item
                    ItemChecked: false // Default unchecked
                }
            )
        )
    );
     
    Bind the checklist collection to a Gallery control. Use filtering to show items for each person.
    Distinct(ChecklistCollection, PersonID)
     
    Add another gallery inside the person gallery to show checklist items for the selected person
    Filter(ChecklistCollection, PersonID = ThisItem.PersonID)
     
    Add a toggle switch or checkbox to update the ItemChecked column
    Patch(
        ChecklistCollection,
        ThisItem,
        {ItemChecked: !ThisItem.ItemChecked}
    )
     
    To identify and display missing checklist items for each person, filter the collection where ItemChecked is false:
    ForAll(
        Distinct(ChecklistCollection, PersonID),
        Collect(
            MissingNotes,
            {
                PersonID: ThisRecord.PersonID,
                MissingItems: Concat(
                    Filter(ChecklistCollection, PersonID = ThisRecord.PersonID && !ItemChecked),
                    ChecklistItem,
                    ", "
                )
            }
        )
    );
     
    lot of steps, pls let me know if you still have issues!
  • ronaldwalcott Profile Picture
    3,866 Moderator on at
    If you have a checklist then I am presuming that each type of checklist has a fixed number of items. Instead of using collections you could have a button which can generate a new checklist to be completed. It will create a parent - child relationship where the parent has the checklist number, user, etc., and the child items contain the prepopulated items associated with the checklist. You would edit the list by adding the associated checkmark and notes.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,009

#2
11manish Profile Picture

11manish 672

#3
Valantis Profile Picture

Valantis 628

Last 30 days Overall leaderboard