Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

All values filter - dropdown values

Like (1) ShareShare
ReportReport
Posted on 5 Sep 2017 20:01:19 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:
  • DavidBrady Profile Picture
    2 on 13 Mar 2020 at 19:46:43
    Re: All values filter - dropdown values
    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
  • BitLord69 Profile Picture
    914 on 06 Apr 2018 at 07:01:21
    Re: All values filter - dropdown values

    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.

  • Community Power Platform Member Profile Picture
    on 28 Mar 2018 at 12:51:38
    Re: All values filter - dropdown values

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

  • nickduxfield Profile Picture
    497 on 06 Sep 2017 at 09:49:59
    Re: All values filter - dropdown values

    Now thats a good solution

  • Verified answer
    CarlosFigueira Profile Picture
    on 05 Sep 2017 at 21:11:49
    Re: All values filter - dropdown values

    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))

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 42 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 36

Overall leaderboard