Filter a Gallery with a drop-down

When dealing with a large list and using a Gallery you will usually want to filter down the values shown. You may also, want to show all of the items in the gallery. You can do this with a drop down and following these steps.

Step 1

Populate the drop-down with values. You can do this by attaching it to a field in a SharePoint list or some other data source. In this example we will just manually put some values in the Items property of the drop-down as shown below. Note that the top value is “All” so the default will be that the gallery contains all items.

Step 2

For the Gallery we will need to combine an If and a Filter in a function. In this example the data source is named Deliverables and the Gallery will need to have the Items property populated with the following function.

If(Dropdown.Selected.Value=”All”, Deliverable, Filter(Deliverable,’Review Cycle’.Value = Dropdown.Selected.Value))

As you can see, if the drop-down value is “All” then the data source for items is just Deliverables and if it is another value is chosen then the Selected.Value of the dropdown is used to filter by comparing it to the ‘Review Cycle’ field