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!
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:
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.
I have tried this and when the if satment is true, it dosen return any items on just returning Events..
Now thats a good solution
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))
WarrenBelz
42
Most Valuable Professional
mmbr1606
41
Super User 2025 Season 1
MS.Ragavendar
36