web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / All values filter - dr...
Power Apps
Answered

All values filter - dropdown values

(1) ShareShare
ReportReport
Posted on by 34

I have a SharePoint list with field "EventType" which contains choices

  

1) Internal

2) External

 

I am creating a dropdown control in powerapps based on SharePoint data source. Dropdown control on the form is only showing two values Internal and External. I am able to filtering based on each one of them but I would like to add "All Events" choice in the drop down which shows all events when users first load the screen. I have added a new choice option in SharePoint field "All Events" but it didn't work as none of the list items are using that choice. I know how to do filtering based on the choice field but I am struggling to show the All values field in the dropdown. Here are my current settings for dropdown field:

 

DropDown control, Items: Distinct(Events, EventType.Value)

(Events: List Name and EventType: field)

 

Thanks!

 

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    You can use the If function to either have all events (if the choice is "all events"), or filter based on the event type. For example, those would be the properties you'd need to set:

    Dropdown1.Items: ["Internal", "External", "All Events"]
    Gallery1.Items:
    If(
    Dropdown1.Selected.Value = "All Events",
    Events,
    Filter(Events, EventType.Value = Dropdown1.Selected.Value))

    That should work for SP lists.

     

    Another option is to have the "All Events" have a value that will match any items - for example, using the StartsWith function. In the example below, if the user chooses the "All Events" option in the dropdown, the gallery will have all items whose event type starts with an empty string (and all valid strings start with an empty string), effectively returning all events.

    Dropdown1.Items:
     Table(
     {Value:"Internal", ColumnStart: "Internal"},
     {Value:"External", ColumnStart: "External"},
     {Value:"All Events", ColumnStart: ""})
    
    Gallery1.Items:
     Filter(
     Events,
     StartsWith(EventType.Value, Dropdown1.Selected.ColumnStart))
  • nickduxfield Profile Picture
    497 on at

    Now thats a good solution

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have tried this and when the if satment is true, it dosen return any items on just returning Events..

  • BitLord69 Profile Picture
    914 on at

    Just a bit of extra bells and whistles... I read my data from a supporting table in the database so I need to take a few extra steps:

     

    • First I create the collection with my Select all (Alla leverantörer) item and empty Search value (Sök)
    • After that I collect the data from my table, sorting it in the process
    • Lastly, I use UpdateIf to set the search value with the name for all items that is not the Select all 

    It works like a charm, so thanks for the initial suggestions.

     

     

    ClearCollect(cLeverantorer; {Namn:"Alla leverantörer"; Sök:""});;Collect(cLeverantorer; Sort('[dbo].[Leverantor]'; Namn).Namn);;UpdateIf(cLeverantorer; Namn <> "Alla leverantörer"; {Sök:Namn})

     

     

    I have another app though that needs to do the same things, but with a number, as opposed to a text in the example above. It works for all the individual items, but what should I set the Select all to? If I leave it blank I get only the records that have a null value. I guess I should let the field have a default value of 0, since 0 has no meaning otherwise.

  • DavidBrady Profile Picture
    2 on at
    Apologies for dusting this off again but I’ve been trying to use the same logic (I think) but it just won’t work. I’m a first time user of powerapp development.

    I have a lookup sharepoint list populated with owner names. Named ‘Owners’ which is linked to a dropdown named ‘drp_Owners’ on my screen. I have added an owner entry “Filter owners” so it’s the default entry.

    I also have a sharepoint list of records, owners can have multiple records and are named within each record, this is titled ‘records’.

    I’d like to display a gallery of all the records by default, and the drop down when selected obviously will Filter the records by owner. I’d like the records to show all once the entry “Filter Owners” is selected (I’d also be keen to revert it to this when the screen changes when I click through to a full record.

    Sorry for the ramble. The main difference is I think that it appears the entries above are directly populated into the dropdown options rather than being pulled from a lookup sharepoint list but I’m not sure why that would be different.

    Cheers
    David

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard