<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=612681139262614&amp;ev=PageView&amp;noscript=1">
Skip to content

Need help? Talk to an expert: phone(904) 638-5743

Power Apps 101 | Learn How Search and Filters for Canvas Apps Works!

Power Apps 101 | Learn How Search and Filters for Canvas Apps Works!

    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.

 

Introduction to Power Apps Canvas Apps

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.

Step 1: Implementing Search in Canvas Apps

Matthew starts with the search functionality. Here's how to add search features to your Canvas apps:

  1. Insert a **Text Input** control from the insert ribbon to allow users to type their search queries.
  2. Rename the control to something descriptive (e.g., "inp_search_park") to make it easier to reference.
  3. Use the following formula for the search command:
    Search(Park, inp_search_park.Text, "ParkName", "City")
  4. To make the search more user-friendly, add a **Clear Button** that lets users clear their search input.

Matthew also highlights a common mistake: leaving the default text input value, which could prevent searches from working correctly.

Step 2: Implementing Filters

Next, Matthew explains how to add filters to the data:

    1. Insert a **Dropdown** control to allow users to filter data based on specific values (e.g., cities).
    2. Use the **Distinct** function to avoid displaying duplicate cities in the dropdown:
Distinct(Park, "City")
  1. Rename the dropdown control (e.g., "DRP_city") for easier reference in your formulas.

To allow users to clear their selection, Matthew also demonstrates how to implement a button that resets the dropdown filter.

Combining Search and 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:

    1. First, he adds a filter for the city column, where the city matches the selected value from the dropdown.
    2. Then, he uses the **Search** function to search the filtered records:
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.

Filtering Based on Date

Matthew demonstrates how to add filtering based on a date. This can be helpful when you need to filter records such as inspection dates:

    1. Insert a **Date Picker** control to allow users to select a specific date.
    2. Use the following filter formula to display records based on the selected date:
Filter(Inspection, InspectionDate = DTP_inspection_date.SelectedDate)
    1. For filtering records between a date range, use **AND** and **OR** operators to combine the conditions:
Filter(Inspection, InspectionDate >= DTP_start_date.SelectedDate && InspectionDate <= DTP_end_date.SelectedDate)

This allows users to filter inspection records within a specific date range.

Conclusion and Next Steps

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.

Sign-up now and get instant access

Leave a comment

Free Community Plan

On-demand learning

Most Recent

private training

Hackathons, enterprise training, virtual monitoring