Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a distinct dropdown list - need to include an "All" choice

I have a gallery and a dropdown that has a distinct list from a SharePoint column. However, I am in need for an "All" selection so that the entire gallery can be selected instead by a single list item.


Distinct('Sharks Database','N# Approved')

Solution Sage
Solution Sage

The old database trick to this to include a single row above the list, then code around whatever value you would profer as this "All". Applying this to PowerApps, you would have to use a Collect() statement to collect a single record (your all), followed by your Distinct('Sharks Database'...) set.


ClearCollect(SharkList, {'N# Approved': "All"}, Distinct('Sharks Database','N# Approved').'N# Approved')


That would put a single line entry above the set of records coming from your datasource.



1) This particular construction would only return 1 field to the dropdown. You can remove the dot-field notation from the Distinct statement to return the entire set of fields, but in that case I would add those fields into the "All" record that you are adding, first. Better if all of the fields are present in all records. Funny things can happen if they are not.

2) If you wanted to sort your returns coming from the datasource (your "Sharks Database"), wrap the Distinct() statement in a SortByColumns() rather than the entire collection, so you don't sort your "All" record down below something like "Adam".

3) How you use this item in selecting/processing items from the Gallery is separate, depending on how you structure your record.

Not applicable

@TimRohr Thanks for the info, but I got the red squiggly lines. error.jpg

Those lines are under the part of the ClearCollect() statement where you decide on a name for your new Collection. You're not using an existing name, are you? We're making a new collection.


Since it is new, let's keep the name simple and space free. It makes typing it easier, later.


So if your datasource is named "Sharks Abroad Credit Transfer Database", we are going to get those records and add one at the top, but we're going to store them in a new object... in a Collection called... you pick...





Not applicable

@TimRohr The bolded area is where the red lines are now.


ClearCollect(ApprovedPlusAll, {'N# Approved': "All"}), Distinct('Sharks Abroad Credit Transfer Database','N# Approved')

Without knowing what the error is, I would say you've most likely put this action statement into a property (like Items) that expects a Table output.


Put this ClearCollect statement on the screen's OnVisible event. Trigger the statement by navigating away from the screen, then back. Now that you have filled the collection, you can assign the ApprovePlusAll collection to be the source of your dropdown.

Not applicable

Thanks for posting in the community @Anonymous - can you review the latest reply and advise if you need further help?



Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,340)