Filtering Dropdown choices in a Power Pages form using Dataverse Relations

Filter dropdowns


Dropdown filters are a useful feature in form design, allowing users to filter options in one dropdown based on other selections in the form. In Power pages, leveraging the capabilities of Dataverse relations makes it possible to create these powerful filtering mechanisms. This is how it works.

What you need to know first.

Before we dive into the implementation details, ensure that you have a basic understanding of Power Pages forms and Dataverse relations. 

How is´t made

  1. Create two tables in your Dataverse environment: "Type" and "Category." These tables will hold the relevant data for the dropdowns.
  2. Establish a Lookup Relationship between the "Category" and "Type" tables. Create a lookup column in the "Category" table that references the "Type" table. This lookup column will allow us to filter the categories based on the selected type.
  3. Now, create a third table called "Request." This table will serve as the foundation for the form where you want to implement the filtered dropdown.
  4. Design the form in Power Pages Designer using the "Request" table as the data source. Add two dropdown controls to the form, one for the "Type" and another for the "Category" field.
  5. Populate the "Type" table with the available types. E.g. "Individual", "Collective" and "Organization".
  6. Populate the "Category" table and relate the different categories to types of requests.
  7. Now go back to the "Request" form in the designer and choose the "Category" control. Check "Filter by related rows" and choose the "Type" table under "Relationship to current table" and select the correct relation name under "Relationship to this lookup´s table".
  8. Now include the form in a page using the Power Pages Designer. When running the page in preview, it should look something like this.
The type is preselected in this instance, and when opening the lookup, the available items should automatically be filtered.


This feature allows you to design effective and easy-to-use forms. After all, your users have other things to do than scrolling through your forms, and I assume that you want quality data ;)

Comments

Popular posts from this blog

Designing and programming - Part 2

Exploring the Power of Variables in Liquid and Power Pages