Creating cascading dropdowns in PowerApps

Cascading dropdowns are used when the user wants to filter a list depending upon a value selected in another dropdown e.g., while filling a form, when the user selects a country, then in the cities dropdown, the user sees the cities of that country.

Scenario

We have an app where users can report office issues. To select an issue type in the Query form, the user should first choose a relevant department to filter the list of available issue types.

1. Create SharePoint lists

Create a SharePoint list named “Relative_Departments” that contains the following columns. 

  • Title – Single line of text
  • Departments – Choice  

Create another SharePoint list named “Initiate_Query” that contains the following columns. 

  • Title – Single line of text 
  • Departments – Choice
  • Query_Type – Single line of text 
  • Initiate_Date – Date

2. Create an App

Go to PowerApps studio.

Create a new Canvas application.

Connect SharePoint lists.

Insert “Labels” for headings, “TextInput” fields, and two “ComboBox” controls for cascading dropdown.

Select the “Items” property of the “DepartmentCombo”, copy the code below, and paste it into the top bar.

Choices(Relative_Departments.Departments)

Select the “Items” property of the “QueryTypeCombo”, copy the code below, and paste it into the top bar.

Code:

Filter(
    Relative_Departments,
    Departments.Value = DepartmentCombo.Selected.Value
)

This formula makes the “QueryTypeCombo” dependent on the selection of the “DepartmentCombo”.

3. Test the cascading behavior

Select options from the “DepartmentCombo” and check if the “QueryTypeCombo” (cascading) dropdown shows the correct relevant options or not.

Select “IT” in “DepartmentCombo”.

Select “Admin” in “DepartmentCombo”.

Select “Management” in “DepartmentCombo”.

Conclusion

The cascading dropdown is successfully implemented. When the user selects a department from the “DepartmentCombo” combo box. The “QueryTypeCombo” combo box will show the choices related to that specific department.

That’s IT Folks