cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
petergriac
Helper II
Helper II

Dropdown field in Sharepoint custom forms

Hi all,

I need a help with my Sharepoint custom form.

I have following sharepoint list:

CATEGORY         SUBCATEGORY

Category 1         Subcategory 1

Category 1         Subcategory 2

Category 2         Subcategory 3

Category 1         Subcategory 4

Category 1         Subcategory 5

Category 2         Subcategory 6

Category 2         Subcategory 7             

 

And I have 2 dropdowns in my form:

CategoryDROPDOWN - looks to CATEGORY column in the list

SubcategoryDROPDOWN look to SUBCATEGORY column in the list. 

 

I would like to filter choice options for SubcategoryDROPDOWN based on CategoryDROPDOWN selection. It means that if user select "Category 1" from CategoryDROPDOWN, he would have only relevant options to choose from SubcategoryDROPDOWN.

Is that somehow possible?

I tried to set Items property in dropdown, but couldn't manage to do this.

 

Thanks a lot.

Peter 

            

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@petergriac 

Yes, this technique is called a "cascading dropdown".

 

I assume you are using a Dropdown and not a ComboBox.  Many people get these 2 controls confused.  My other assumption is the values in your SharePoint list are single-line text, not Choices.

 

Use this code in the Items property ofSubcategoryDROPDOWN to show only those matching values from CategoryDROPDOWN.

Filter(your_sharepoint_list, Category = CategoryDROPDOWN.Selected.Value).SUBCATEGORY

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @petergriac ,\

I will use your names and assume the Items of CategoryDropdown are from a list or collection also containing the SubCategory valueI will also call the source data Categories

The Items property of SubCategoryDropDown should be

Filter(
   Categories,
   SubCategory = CategoryDropdown.Selected.SubCategory
).SubCategory
   

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

mdevaney
Super User
Super User

@petergriac 

Yes, this technique is called a "cascading dropdown".

 

I assume you are using a Dropdown and not a ComboBox.  Many people get these 2 controls confused.  My other assumption is the values in your SharePoint list are single-line text, not Choices.

 

Use this code in the Items property ofSubcategoryDROPDOWN to show only those matching values from CategoryDROPDOWN.

Filter(your_sharepoint_list, Category = CategoryDROPDOWN.Selected.Value).SUBCATEGORY

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@mdevaney,

Thanks a lot. Is there also a way to have all subcategories if user doesn't select category?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,030)