Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

Can't create Collection using ClearCollect Function

I encountered a challenge when following the guidelines of this article.
In the Step: Writing the related schools into a collection

Faculty Field -> OnChange: 

ClearCollect( collSchools, { Schools: Filter( Schools, Faculty.Value = DataCardValue2.Selected.Value ) } )

Property Explanation

collSchoolsThis is our collection where all related schools for the selected faculty are written in to
SchoolsThis is the name of the column where the data is written in to
FilterThis is the function that filters values from a data set. The format of this function is as follows: Filter(source,logical_test)
SchoolsThis is the data set that we use in our filter. In this case, it is the Schools list we added as data source
Faculty.ValueThis is the value we are looking for in our data set. In this case, it is the Faculty lookup field in our Schools list
DataCardValue2.Selected.ValueThis is the selected faculty from our PowerApp


I follow this fomulas but the result is an empty collSchools Collection.

Here is my Form Setting

Screen Shot 2019-10-08 at 9.17.34 PM.png

And the OnChange of Faculty Dropdown:

Screen Shot 2019-10-08 at 9.18.52 PM.png

And the collSchools Collection: Empty School Column

Screen Shot 2019-10-08 at 9.19.26 PM.png

Can anyone help me resolve this problem?




Ok so it means something is incorrect in your data


CountRows(Filter( Schools, Faculty.Value ="hardcoded value" ))


When you go to SP list Schools - does it have any data? I am assuming Yes

Does it have values in Faculty column - see the values there

then try and hardcode that value exactly in the hardcoded value in formula above and test




I have discovered a serious problem with Preview Mode. I think it is the cause of this problem.

My Preview Function is not working. It's mean when I press F5 you can see my form like this:

Screen Shot 2019-10-09 at 10.20.31 AM.pngEdit ModeScreen Shot 2019-10-09 at 10.20.24 AM.pngPreview Mode

It may be that it cannot recognize the value of drpd_Faculty.Selected.Value. And return an empty Collection.
Follow Pstork1's advice, I create a button with OnSelect Property:

ClearCollect( collSchools, { Schools: Filter( Schools, Faculty.Value = "Faculty of Health" ) } )

And it's work.

But when I go back for  

ClearCollect( collSchools, { Schools: Filter( Schools, Faculty.Value = drpd_Faculty.Selected.Value ) } )

It does not work anymore.

Helpful resources

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.


Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (5,851)