How to Create a Gallery in Canvas Apps with Filters Across Different Column Types (Dataverse)
Frequently when building a canvas app for a client, I run into the need to create a gallery that is filtered by different categories. This can be more complex than it appears because different column types need to be handled in different ways. Another issue you encounter is handling cases when nothing is selected in your filters. Below I’ll walk through how to set this up step by step.
Step 1: Set up the page
Create a Canvas App page with a gallery connected to your dataset and an area where you can put your filter selections. In my example, I’m connecting to a list of books I’ve read, stored in a Dataverse table.
Gallery Set Up
Step 2: Determine your filters
Think through what filters make sense for your dataset and what type of input works best for each. In my example, I’m using:
Title – Text input box
Last Read Date – Two date inputs for a From and To range
Author – Lookup column (combo box connected to the Author table, single-select)
Rating – Whole number 1–5 (combo box with items
[1,2,3,4,5]
, multi-select)
Page Filters
Step 3: Build your filter logic
Now update the Items property of the gallery to use the different filters. PowerFX allows you to nest filters together instead of creating multiple separate filters.
Title (Text Input)
For text inputs, you need to check for blank values and then compare against your column. Always include .Value
when referencing the control:
IsBlank(tib_TitleSearch.Value) || tib_TitleSearch.Value in Title
This allows users to type part of a title instead of having to match it exactly.
Last Read Date (Date Pickers)
For dates, I recommend creating two date pickers: From and To. Use .SelectedDate
for each one.
// From
IsBlank(dp_DateFrom.SelectedDate) || 'Last Date Read' >= dp_DateFrom.SelectedDate
// To
IsBlank(dp_DateTo.SelectedDate) || 'Last Date Read' <= dp_DateTo.SelectedDate
This way you can handle ranges, and if one is left blank it won’t block your results.
Author (Lookup Column)
Lookups in Dataverse are a little different. You can’t just compare against the display name—you need to compare against a unique value such as the GUID or primary column. Also, make sure to check if the combo box is blank using .Selected
.
IsBlank(cbb_Author.Selected) || 'Primary Author'.'Author (kchbk_authorid)' = cbb_Author.Selected.'Author (kchbk_authorid)'
This ties your lookup column on the Books table to the selected Author.
Rating (Multi-Select Combo Box)
For multi-selects, the combo box stores results in a table. You need to use SelectedItems.Value
and check if your column value exists in that table.
IsBlank(cbb_Rating.Selected) || 'My Rating' in cbb_Rating.SelectedItems.Value
This allows multiple ratings to be chosen and compared.
Step 4: Put it all together
Here’s the full filter formula:
Filter(
Books,
IsBlank(tib_TitleSearch.Value) || tib_TitleSearch.Value in Title,
IsBlank(dp_DateFrom.SelectedDate) || 'Last Date Read' >= dp_DateFrom.SelectedDate,
IsBlank(dp_DateTo.SelectedDate) || 'Last Date Read' <= dp_DateTo.SelectedDate,
IsBlank(cbb_Author.Selected) || 'Primary Author'.'Author (kchbk_author)' = cbb_Author.Selected.'Author (kchbk_author)',
IsBlank(cbb_Rating.Selected) || 'My Rating' in cbb_Rating.SelectedItems.Value
)
This setup gives you one clean formula that handles multiple filter types while also making sure nothing breaks if a filter is left blank.
Filter Formula
Closing Thoughts
Setting up a gallery with multiple filters in Canvas Apps doesn’t have to be complicated. By handling blank inputs, understanding how each column type works, and combining everything into a single Filter(...)
, you can give your users a flexible and easy-to-use experience. This post focused on the basics, but in future posts I’ll dive deeper into more advanced filtering patterns you can use to take this even further.
Filtered Table in Action