Showing results for 
Search instead for 
Did you mean: 
Advocate V
Advocate V

ForAll or something else?

I have developed an app that creates appointments during any given day.  Requirements are that there cannot be more than four persons in ten minute time slot increments.  I created a TimeSlot collection seen here.  This is a gallery showing this collection, but now what I need to do is filter the gallery items based on the date selected (stored in a variable called _currentDate) and where the count of each item in TimeSlot is less than 4.  I can easily do the RowCount, but how do I iterate through each time slot to get that RowCount?  My guess is I need to create a temporary table and use that as the Gallery item?  Thanks for the information


UPDATE:  I pretty much solved this going another route (but I still would like to know if the ForAll is feasible for my own understanding).  In the datacard, I set another text label to do a count on each ThisItem.Value and the set this formula in the Visible property: If(Value(lblCurrentScheduledCount.Text)<4,true,false)




Super User
Super User

Hi @guyinazo 


If your data source has the information saved (# of items), you don't need to loop through all of them. A simple Filter would be sufficient. 


If your data source does not contain the desired data, you would probably best going with a ForAll() and AddColumns(). Meaning, while looping through each of your time slots, you could add an additional (temporary) column. For example the # of items for that time slot.


Once you have that, you can then filter on that.


I hope this helps.

Kind regards,


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!


Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (59,376)