In this tutorial, Matt Peterson from Pragmatic Works explains how to efficiently search and filter data in Canvas apps using multiple controls. Whether you are new to Canvas apps or want to enhance your existing skills, this post will guide you step by step through the process.
In this tutorial, Matthew introduces the process of searching and filtering data in Power Apps. Using a Canvas app example that includes park records and inspection records, he demonstrates how these features can be applied to build more functional and user-friendly apps.
Matthew starts with the search functionality. Here's how to add search features to your Canvas apps:
Search(Park, inp_search_park.Text, "ParkName", "City")
Matthew also highlights a common mistake: leaving the default text input value, which could prevent searches from working correctly.
Next, Matthew explains how to add filters to the data:
Distinct(Park, "City")
To allow users to clear their selection, Matthew also demonstrates how to implement a button that resets the dropdown filter.
One of the most powerful features of Canvas apps is the ability to combine both search and filter functionalities. Here’s how Matthew combines these two elements:
Search(Filter(Park, City = DRP_city.Selected.Value), inp_search_park.Text, "ParkName", "City")
With this, the app can filter the parks by city and search through those filtered records at the same time.
Matthew demonstrates how to add filtering based on a date. This can be helpful when you need to filter records such as inspection dates:
Filter(Inspection, InspectionDate = DTP_inspection_date.SelectedDate)
Filter(Inspection, InspectionDate >= DTP_start_date.SelectedDate && InspectionDate <= DTP_end_date.SelectedDate)
This allows users to filter inspection records within a specific date range.
Matthew wraps up the tutorial by mentioning that these are just the basics. For users looking to deepen their knowledge, he recommends checking out Pragmatic Works' **Canvas Apps beginner to pro** course and the **advanced Canvas app skills** series.
Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Canvas Apps and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.