#PowerPlatformTip 23: 'Filter Blank'
TL;DR: Add IsBlank(YourFilterInput) to a gallery’s Filter so it shows every item when the search box is empty.
💡 Challenge
Filtering galleries in PowerApps based on user input (like text input, dropdown, or combo box) is common, but when the input is empty you usually want to show all items.
✅ Solution
Add an || IsBlank(YourFilterInput) condition to your filter formula.
🔧 How It’s Done
-
Create a gallery and set up your filter inputs (e.g., text input, dropdown, combo box).
-
Apply the following formula to your gallery’s Items property:
1
Filter(YourDataSource, Condition || IsBlank(YourFilterInput))
🔸
YourDataSourceis the source of your data.🔸
Conditionis your filtering condition (e.g.,TextInput.Text = ThisItem.Field).🔸
YourFilterInputis the input control (e.g., TextInput, Dropdown).
🎉 Result
When the filter input is empty, the gallery shows all items. If the input is provided, the gallery filters based on the specified condition.
🌟 Key Advantages
🔸 Simplifies gallery filtering logic.
🔸 Enhances user experience by dynamically displaying all or filtered data.
🔸 Reduces the need for multiple filtering conditions.
🔗 Related Tips
🔸 #PowerPlatformTip 33: ‘Coalesce’ - replace nested If(IsBlank()) checks elsewhere in the same app with one function.
🔸 #PowerPlatformTip 38: ‘Data Refresh’ - keep this gallery’s data fresh without reloading everything on every keystroke.
🎥 Video Tutorial
🛠️ FAQ
1. Can I use multiple filter conditions with the IsBlank() check?
| Yes, you can combine multiple conditions using && or | operators while still including the IsBlank() check for each filter input. |
2. Does this technique work with all data sources in PowerApps?
Yes, this filtering approach works with SharePoint lists, Dataverse tables, SQL databases, and other supported data sources.
3. How can I handle multiple filter inputs simultaneously?
Create compound conditions like: Filter(DataSource, (Condition1 || IsBlank(Input1)) && (Condition2 || IsBlank(Input2))).
This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy – live Power Platform workshops, free or CHF 49. Join the workshop waitlist to get notified about new dates. For companies that want this implemented for them, see KMUpower – Power Platform consulting & automation for SMEs (DACH).