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 Apps Africa Challenge 2022

Power Apps Africa Challenge

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

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,848)