cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

@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
Highlighted
Super User III
Super User III

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.

Highlighted
Super User III
Super User III

@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

Highlighted

@mdevaney,

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,963)