Filtering Dropdown choices in a Power Pages form using Dataverse Relations
Filter dropdowns
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
- Create two tables in your Dataverse environment: "Type" and "Category." These tables will hold the relevant data for the dropdowns.
- 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.
- 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.
- 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.
- Populate the "Type" table with the available types. E.g. "Individual", "Collective" and "Organization".
- Populate the "Category" table and relate the different categories to types of requests.
- 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".
- Now include the form in a page using the Power Pages Designer. When running the page in preview, it should look something like this.
Comments
Post a Comment