Forum Discussion
Collection not populating
- Apr 18, 2022
Hi ADumith , I downloaded and imported your app. I refreshed the source data to be my SP list and used the collection and filter elements I've shared and it seems to work fine. I would encourage annotating references wherever possible.
My SP list is structured like this:
My date source in the app is targeted at the list:
The 'OnStart' property is set to:
The gallery items is set to:
The first of your gallery fields is set to:
The second of your gallery fields is set to:
Without access to your source list I'm unsure what may be wrong at your end. I can use your app, redirect it and modify a few of the field names/targets and it appears to be working.
Hello!jonlake
Thank you very much for continuing to help me.
I already managed to get the collection to load data. Goal achieved.
But the records are still not displayed in the gallery. The data source is the collection, and the fields are properly mapped, in fact when I place only the collection the data is shown, but when placing the filter none is shown.
Without filter
Filtering.
Create a new collection to test and the behavior is the same.
Why the filter does not work?
Thanks again.
Hi ADumith, I recommend adding a button to test, just in case closing and restarting the app doesn't force the 'on start' setting of the variable. Something like this:
If that doesn't test the population of the gallery I would check the format and content of the month field in your SP list. I've attached a version of the test app I've built. Simply redirect to you SP list.
- ADumithApr 18, 2022Iron Contributor
Hello jonlake
I realized why the collection sometimes doesn't populated, when that happens I just save the app, close PowerApps and go back in.
The Dbirth and Mbirth fields are fields of type Single line of text.
It is possible to create a filtered and ordered collection at the same time and thus in the gallery I only map to the collection. What do you think about the idea?
By the way, thanks for sending me the app but due to security policies I can't upload it to our platform.
Thanks again,
- jonlakeApr 18, 2022Iron Contributor
Hi ADumith , you can do it at the gallery items level:
//filter the gallery items to only show those with a birth month matching the current month
Sort(Filter(colBirthDay,month_of_birth=varMonth),date_of_birth,Descending)In my previous responses I've mentioned the Onstart action, which creates a sorted (but not filtered) collection:
//create a collection of all employee records in ascending order by mbirth
ClearCollect(colBirthDay, Sort(EmployeesDirectory,month_of_birth,Ascending));- ADumithApr 18, 2022Iron Contributor
Hellojonlake
I'm really confused, there is no way for the filter to work, I don't know what else to try, I generated a new app to try and the result is still the same.
I send you the app, maybe you are able to see something that I don't see.
I don't know what to think.
It' not make sense,