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'.
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.
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.
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).
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.
Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.
Your chance to join an engaging competition of Power Platform enthusiasts.