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

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,431)