cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chrisjames2678
New Member

Powerapps collection not fetching data

Hi, 

I have a very basic problem that I can't seem to solve.

I am trying to build a very simple org chart, and have a dropdown filter for a gallery.  I would like to create a collection so that I can display all results in the filter.  I am trying to follow this video here:https://www.youtube.com/watch?v=kLGglidmPxg and I'm at the stage where I need to create the collection, which seems easy enough:

 

For the screen, whilst set to OnVisible, I add: ClearCollect(collectEmployees, Distinct(Table1, AREA))

Employees = this will be the name of my collection

Distinct(Table1, AREA) = Table1 is my gallery, and they are currently filtered by the AREA field, and the dropdown filter uses 'Distinct(Table1, AREA)' to ensure only a single instance of each AREA shows in the dropdown.

 

When I check to see what results are being fetched with that collection, it returns 'we didn't find any data'.collectEmployees.png

 

As far as I can tell, it should populate the collection with distinct values from the AREA field of the data source...

 

I know I'm doing something very basic wrong, but can't figure it out.

 

 

5 REPLIES 5
cwebb365
Super User
Super User

If you need to pull from a gallery you need to reference gallery.allitems in the first part of distinct. However keep in mind distinct is not delegable so if you ever envision the gallery or the items in the gallery to exceed 500 default or 2000 items you run the chance of not getting all the distinct values as it will only pull them up to that amount based on the app settings so any values over the first set of those will be missing.  

chrisjames2678
New Member

I don't think I want to pull from the gallery as such - I want to pull from the list of distinct items for a single field.  So, for example, I have 150 unique rows in my data, but I only have 10x unique entries for the field "AREA" so I assumed that I need the collection to hold that distinct list only (as per the video around 10:22 in).

cwebb365
Super User
Super User

That’s fine and all. You just have to make sure your list you are getting distinct values from never exceeds your delegation setting which is 500 by default or 2000 max. Otherwise you will start to miss distinct values since it will only evaluate up to those amounts since distinct() isn’t delegable.  You just have to keep that in mind when using it.  

chrisjames2678
New Member

Ok, thanks for that.  I'll keep it in mind.  I'm still not clear why the collection is empty though and it isn't returning anything at all?!

cwebb365
Super User
Super User

Try putting in what you have for your items property in your gallery In the distinct(). 

if I recall can be like distinct(galitemsprop.Area) 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (3,185)