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 / Loop over list with co...
Power Apps
Answered

Loop over list with components and check there output values

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

In my app the user can do different tasks and if all tasks are done a text should be displayed.

 

For the tasks I have a component TaskBox with an output variable done, which is true if the task is done.

 

How can I check if all these tasks are done?

 

What I have thought so far is to store the instances in a list - loop over it and store if all are done in a variable, which I will put in the Visible method of the text I want to show then.

 

 

 

 

Set(eTasks, [TaskBox_1, TaskBox_2, TaskBox_3, TaskBox_4, TaskBox_5]);

 

 

 

How can I now loop over that list and check if all are done / one is not done. Or do you have an other idea to solve that, without doing it manually lik:

(because I will have many of them and they should be added easily)

 

 

 

Set(all_done, If(TaskBox_1.done = True and TaskBox_2.done = True ..., ture, false))

 

 

 

 

In python it would work like that:

 

 

 

all_done = True
for task in eTasks:
 if task.done == False:
 all_done = False

 

 

 

 

Categories:
  • Waegemma Profile Picture
    583 Super User 2024 Season 1 on at

    Hi @Anonymous ,

     

    Manually can be shorter:

     

    Set(all_done; TaskBox_1.done && Taskbox_2.done && ...)

     

    Will think about better way later (no time 🙂  )

     

    Marc 

  • Verified answer
    uwenagel Profile Picture
    382 on at

    If you use a collection instead of an array you could loop through the collection with ForAll afterwards:

     

    Create Collection:

    ClearCollect(eTasks,{Task:TaskBox_1},{Task:TaskBox_2},...);

     

    The loop would look like the following:

    ClearCollect(myResult,{Result:1});  // Initialize first element of collection to 1.

    ForAll(eTasks,If(!Task.done,Patch(myResult,First(myResult),{Result:0}))  // First collection element changed to 0 if the task is not yet done.

     

    Later you could see the final result by checking First(myResult).Result. If this is still 1 (as initialized) this would mean, that all the tasks are done. Please note that you have to use a collection and a Patch function because you cannot use 'Set' in a ForAll loop.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

    If the content was useful in other ways, please consider giving it Thumbs Up.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard